What is a singleton class?
Class which can't be extended, means only one definition for that class will be there.
Class for which we can create only one object
Class for which we can't create any object
Class which has only one base class.
It is a design pattern, where a class is designed in such a way that, there is only object for that class. This can be achieved in many ways, general way of implementation is by making the constructor as private, and creating and returning object through a static method of that class.
Back To Top