Code Pumpkin

Category Archives: Core Java Interview Questions

How is HashSet implemented internally in Java?

September 27, 2017
Posted by Abhi Andhariya

In our previous article, we have seen internal implementation of SynchronizedMap and the difference between HashMap, Hashtable, SynchronizedMap and ConcurrentMap.  In this article, we will understand how does HashSet work internally? How JDK implementers have reused HashMap effectively for HashSet implementation.   The best way to understand internal implementation of any built-in Java class is by looking into its […]

Hashtable vs SynchronizedMap vs ConcurrentHashMap

Java Collection classes are heart of Java API.  It is essential to use built-in java collections like HashMap, ArrayList or LinkedList for accessing, storing and processing data in java applications. For Example, we have extensively used HashMap to transfer data between two layers of our MVC framework.   In all core java interviews, you will definitely face questions on […]

Class Loader SubSystem | JVM Internals

August 5, 2017
Posted by Riteeka Rathod

​In our previous article of JVM internals series, we learned about what is JVM, basic architecture of JVM and briefly understood its components. In this article we will discuss in detail about Class Loader SubSystem component of JVM architecture . Class Loader SubSystem Java’s dynamic class loading functionality is handled by the Class Loader SubSystem. […]

What is the use of private constructor in java?

In Java, we can use any access modifier (i.e. public, protected or private) with constructor.  So, what are the uses of making constructor private? First thing that strikes your mind is Singleton Design Pattern which is also one of the most asked Core Java Interview Question to the 3-4 yr exp Java developers.  Apart from creating singleton class, private constructor […]

Interface vs Abstract class in Java

July 7, 2017
Posted by Abhi Andhariya

Interface has been evolved a lot in last two releases of java. Refer interface evolution in java for the same. However, there are still many differences between interface and abstract class. It is one of the most asked interview questions for entry level java developer interviews. Even though both are used to achieve abstraction in java, there are significant differences […]

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 […]

Wrapper Classes | Interview Questions

April 22, 2017
Posted by Abhi Andhariya

In this post, we will discuss some of the most asked interview questions on wrapper classes. Java is an object-oriented language and can view everything as an object. A simple file can be treated as an object (with java.io.File), an address of a system can be seen as an object (with java.util.URL) and an image can be treated as an […]

Singleton Design Pattern

In Design Pattern article, we have seen different types of design patterns. In this article, we will understand one of the simplest Creational Design Pattern i.e. Singleton Design Pattern. What is the purpose of Singleton? The purpose of the singleton class is to control object creation, limiting the number of objects to only one. The singleton allows only […]

Next posts
Total Posts : 124
follow us in feedly

Like Us On Facebook