What is singleton class in java?

DWQA QuestionsCategory: QuestionsWhat is singleton class in java?
Editor Staff asked 3 weeks ago

What is singleton class in java?

1 Answers
Editor Staff answered 3 weeks ago

The singleton design pattern is used to restrict the instantiation of a class and ensures that only one instance of the class exists in the JVM. In other words, a singleton class is a class that can have only one object (an instance of the class) at a time per JVM instance.