Singleton Design Pattern Interview Questions

What is Singleton Pattern ? Singleton pattern is used when we want to create only one instance of a class. A very simple example is say Logger, suppose we need to implement the logger and log it to some file according to date time. In this case, we cannot have more than one instances of […]

Java Design Pattern Interview questions

  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 […]