Code Pumpkin

Category Archives: Core Java

InterruptedException in Java Multithreading

InterruptedException is thrown when a thread is waiting, sleeping, or otherwise occupied, and the thread is interrupted, either before or during the activity. Before reading this article, I recommend you to go through my article interrupt(), interrupted() and isInterrupted() in Java Multithreading. There are some methods in JDK that check the Interrupt status flag for us and throw InterruptedException, if it […]

interrupt(), interrupted() and isInterrupted() in Java Multithreading

In this post, we will understand about interrupt(), interrupted() and  isInterrupted() methods in Java Multithreading. If you are interested in reading more about interruption mechanism you can look into our post InterruptedException in Java Multithreading. In Java, thread starts its execution when we call start() method on Thread object. It internally calls overridden run() method. Thread is said to be terminated when […]

Transient Keyword In Java

May 13, 2017
Posted by Dipen Adroja

The transient keyword in java is used on class attributes to indicate that serialization process of such class should ignore such attributes for any instance of that class. When JVM comes across transient keyword, it ignores original value of the variable and save default value of that variable data type. transient keyword plays an important […]

Default Method In Interface | Java8

May 13, 2017
Posted by Dipen Adroja

In this article, we will discuss Default Method in interface which was introduced from Java8. This feature allows developer to add new methods to the interfaces without breaking the existing implementation of these interface. It provides flexibility to allow interface to define implementation which will will be used when concrete class does not provide an implementation […]

Stream API | Java8

May 12, 2017
Posted by Dipen Adroja

In this article, we are going to walk through Stream API which is introduced as a part of Java8. Using Stream API, we can make our collection manipulation more declarative and thread safe in case of multi-threaded environment with very ease. The advantage of using Stream API to manipulate collections is we only ask the […]

CountDownLatch in Java Concurrency Utilities

May 5, 2017
Posted by Abhi Andhariya

CountDownLatch in Java Concurrency is a type of synchronizer which allows one Thread to wait for one or more Threads before it starts processing. You can implement the same functionality using wait() & Notify() mechanism but it requires lot of code and getting it write in first attempt is tricky,  With CountDownLatch it can  be done in […]

How does HashMap work internally in Java?

May 4, 2017
Posted by Abhi Andhariya

How does HashMap work internally in java is one of the most asked core java interview questions. Most of the candidates do not give the satisfactory explanation. This question shows that candidate has good knowledge of Collection. So this question should be in your TO-DO list before appearing for the interview. There are four things we should […]

How to create Immutable Class in Java

Immutable class is a class which once created, it's contents can not be changed. In other words, Immutable objects are the objects whose state can not be changed once constructed.  In Java, String and all the wrapper classes e.g. Boolean, Integer, Long, etc are immutable classes. We can also create our own immutable class.  Why should we write Immutable Classes? Here are […]

Java8 Features

April 22, 2017
Posted by Dipen Adroja

Java 8 is released in March 2014. In this article, we will look into some of the java 8 features with examples. You can download JDK 1.8 from here based on your OS Platform requirements. We are going to cover below important features of the Java8: Lambda Expressions Functional Interfaces Stream Collection Type Interface Default […]

Functional Interface | Java8

April 22, 2017
Posted by Dipen Adroja

In this article, we are going to discuss about one of the Java8 feature: Functional Interface. Java 8 is released in March 2014. You can download JDK 1.8 from here based on your OS Platform requirements. Java developer around the world frequently uses the Runnable, Comparator, Callable etc. One common thing about the above mentioned interfaces […]

Previous Posts Next posts
Total Posts : 124
follow us in feedly

Like Us On Facebook