Singleton pattern in Java

Singleton Pattern Singleton pattern ensures that only one instance of a class is created in the JVM. Once initialized, no more instances of that class can be created and previously created instance should be used across JVM.  One thing to note – Even if there are multiple class loaders within a JVM, object instance should be same and

Why I moved to IntelliJ Idea (IntelliJ vs Eclipse)

IntelliJ Idea Vs Eclipse (Easy transition from Eclipse to IntelliJ) June 04′ 2015 After using Eclipse for almost 10 years, I recently moved to IntelliJ and can surely say I am a happy user.  Not only Eclipse to IntelliJ, any IDE switch brings some usability issues in beginning and productivity goes down but once you are

Java Multithreading Issue – Partially populated objects

Overview This document highlights one of the most common multi-threading problem in java applications. There is a very common use-case where one thread (t1) creates and populates the object whereas another thread (t2) tries to access it at the same time. To avoid synchronized block which supposedly might impact performance, programmers put in null check so that second thread (t2) uses