Singleton
Singleton is most important and frequently used design pattern in java . It restricts the instantiation of a class and ensures that only one instance of the class exists in the java virtual machine. To be precise , in a particular jvm there can be only one instance of this kind of class . This kind of class provides a global access point of the class as it does not allow to create multiple instance of the class . This pattern is useful for logging , driver object , caching , thread pool . There are different approaches to implement singleton classes . But all of those approaches consist of following rules in common : Private constructor to restrict instantiation of the class from other classes. Private static variable of the same class that is the only instance of the class. The global access point to instantiate the class is a public static...