+1 vote
in Design Patterns by
What is Singleton Pattern in Java?

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.

Related questions

+1 vote
asked Oct 17, 2019 in Design Patterns by Robin
0 votes
asked Jul 24, 2023 in Design Patterns by SakshiSharma
...