in Design Patterns by
Q:
What is Singleton Pattern in Java?

► Click here to show 1 Answer

0 votes
by
Singleton pattern is a creational pattern which allows only one instance of a class to be created which will be available to the whole application. The major advantage of Singleton design pattern is its saves memory because the single instance is reused again and again; there is no need to create a new object at each request. For example, in our application, we can use a single database connection shared by multiple objects, instead of creating a database connection for every request.
Learn More with Madanswer

Related questions

0 votes
asked Oct 16, 2019 in Design Patterns by DavidAnderson
...