Singleton Design Pattern Using Double Checked Locking
This is our second article in the series of Singleton Design Pattern. In this article, we will see different thread safe approaches for lazy Initialization Singleton Design Pattern like Using Synchronized getInstance() method, Double checked locking approach and Bill Pugh Implementation using Inner class. For navigating to the other articles on Singleton Design Pattern, please refer table of contents on the right […]
Sapient Global Markets Interview Questions – Set 3
Hey everyone, I am writing this article for the people who wants to appear for Sapient Global Markets. I appeared for Senior Application Developer in Sapient Global Markets Bangalore on August 2017. I would Like to share my experience with you guys. I will cover Technical round question and some brief intro of Sapient GM process. I went […]
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 […]
Defining and Starting a Thread | Thread VS Runnable
Java threads are objects like any other Java objects. Threads are instances of class java.lang.Thread, or instances of subclasses of this class. In addition to being objects, java threads can also execute code. Creating and Starting Threads Here is the code to create a Thread and start its execution. // Creates Thread Object Thread thread = […]
CountDownLatch Vs CyclicBarrier | Java Concurrency Utilities
CountDownLatch Vs CyclicBarrier : Though both are used as a synchronization aid that allows one or more threads to wait but there are certain differences between them that you should know in order to know when one of these utilities will serve you better. As per the java.util.concurrent API, CountDownLatch: A synchronization aid that allows one or more threads to […]
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 […]