Introduction to Singleton design pattern Singleton Design Pattern is used in object-oriented programming to ensure that a class can have only one instance, while providing a global point of access to this instance. A very simple example is Logging class. suppose we need to implement the logging class (say Logger) and log it to some …
Continue reading Singleton Design Pattern Interview QuestionsDesign Pattern
1 – If two different classloaders load a singleton class, would they load it twice ? Two objects loaded by different class loaders are never equal even if they carry the same values. So, each class loader will have its own singleton. 2 – What is Decorator design pattern ? The decorator …
Continue reading Java Design Pattern Interview questions