Oct 27, 2020 in JAVA
Q: What is a singleton class in Java? What’s the benefit of making a class singleton?

1 Answer

0 votes
Oct 27, 2020

What is a singleton class in Java? What’s the benefit of making a class singleton?

1) A singleton class is a class in Java that can at most have one instance of it in an application. If new instances are created for the same class they point to the first instance created and thus have the same values for all attributes and properties.

2) Singleton classes are created to create global points of access to objects. Singleton classes find their primary usages in caching, logging, device drivers which are all entities for universal access.

Click here to read more about JAVA
Click here to read more about Insurance

Related questions

+1 vote
Jun 25, 2019 in Dot Net
...