View Tanya  Sharma 's Profile
What is singleton?
It is one of the design pattern. This falls in the creational pattern of the design pattern. There will be only one instance for that entire JVM. You can achieve this by having the private constructor in the class. For eg., public class Singleton { private static final Singleton s = new Singleton(); private Singleton() { } public static Singleton getInstance() { return s; } // all non static methods … }
Asked by Tanya Sharma | Sep 11 2017 | Report this Report abuse
Replies (3)
View Shatish  Rao 's Profile
What is Class.forName() does and how it is useful?
Sep 19 2017 | Report this Report abuse
View Shuchita   Shukla 's Profile
Below link could help for detailed description with examples

http://www.benchresources.net/singleton-design-pattern-with-java-serialization/

http://www.benchresources.net/singleton-design-pattern-restricting-all-4-ways-of-object-creation-in-java/
Sep 19 2017 | Report this Report abuse
View Khushi   Kumari 's Profile
Below link could help for detailed description with examples

http://www.benchresources.net/singleton-design-pattern-with-java-serialization/

http://www.benchresources.net/singleton-design-pattern-restricting-all-4-ways-of-object-creation-in-java/
Sep 18 2017 | Report this Report abuse