Code Pumpkin

Category Archives: Core Java

Subscribe

Marker Interface Interview Questions

December 12, 2017
Posted by Pumpkin

The interface in java is a mechanism to achieve abstraction and it is one of the most discussed topic in entry and mid level java developer interviews. In our previous articles on interface, we have seen various interface related topics like  Interface Evolution in Java  Difference between interface and abstract class  Functional interface in java 8  In this […]

What is magic number CAFEBABE in java class file?

November 29, 2017
Posted by Pumpkin

Java Compiler compiles a java source code into bytecode and stores it into .class file which will then get executed by JVM. Everybody knows about it. But do you know each class file in Java starts with magic number CAFEBABE?  compelling, isn't it? 😀  After reading this article, you will be able to answer below questions: […]

Find from where java class is loaded | Class Loader SubSystem

November 1, 2017
Posted by Pumpkin

In previous article, we discussed about 3 activites of Class Loader SubSystem i.e. Loading, Linking, Initialization and its Types of Class Loader  i.e. Bootstrap Class Loader or primordial Class Loader, Extension Class Loader, Application Class Loader or System Class Loader. We have also seen how these Class loader uses Delegation hierarchy algorithm  to load Classes into memory area. In this article we'll discuss more about Class Loader and how […]

What is optional and why it is there? | Java8

October 29, 2017
Posted by Pumpkin

Have you ever been tired of putting null checks all over the code to avoid any unnecessary NullPointerExceptions. Java 8 has introduced a new class Optional in java.util package. It is used to represent a value is present or absent. The main advantage of this new construct is that No more too many null checks and NullPointerException. It avoids […]

Performance Issue with HashSet RemoveAll() method

October 12, 2017
Posted by Pumpkin

In our previous article on HashSet internals, we have seen internal implementation of its add(), remove(), contains(), clear(), iterator() and isEmpty() methods. One of our readers has raised question about How efficient is HashSet removeAll() method? As it requires detailed explanation, we have decided to write separate article on it.   What does removeAll() method do? Before going into internals of […]

How is HashSet implemented internally in Java?

September 27, 2017
Posted by Pumpkin

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

String Pool | Java

September 2, 2017
Posted by Pumpkin

String pool in Java is a pool of String literals and interned Strings in JVM for efficient use of String object. Since String is Immutable Class In Java, it makes sense to cache and shares them in JVM. Java creators introduced this String pool construct as an optimization on the way String objects are allocated […]

Access Modifiers in Java

September 2, 2017
Posted by Pumpkin

In this article, we will discuss one of the basic feature of Java- Access Modifiers. As the name suggests access modifiers in Java helps to restrict the scope of a class, constructor, variable, method or data member. Assigning an access modifier to a class, constructor, field or method is also sometimes referred to as "marking" that […]

Types of Class Loader | Delegation Algorithm | JVM Internals

August 13, 2017
Posted by Pumpkin

In previous articles, we learned about JVM architecture and one of its component Class Loader SubSystem. In this article,  we will discuss about Types of Class Loaders and How Class Loader uses Parent delegation Algorithm to load the class. If you have not gone through previous article on JVM Internals, I would encourage you to read that first. […]

Previous Posts

Total Post : 82
Subscribe
Contribute Your Articles

Interview Experiences

Related Books

Like Us On Facebook

Alexa Page Rank