Refer my previos rep:Method 3 is a way to create per thread singleton object. ie. every thread will have its own singleton object for its own disposal.Method 2,1 will fall into a waiting state for singleton object until freed from other thread, adding to performance issue.
There r several way to create Singleton object:1. By using single static private object & using a static method while returning same object on every call. 2. using a static boolean flag for checki...