Singleton class is a class whose only one instance can be created at any given time in one JVM.
- Make constructor as private, so that instance cannot be created outside the class.
- Private static instance needs to be created in that class itself.
- Static method should created a new instance if the value is null. Otherwise it should return the old instance. New instance creation will be avoided.


Leave a comment