WHAT IS SINGLETON CLASS?

Amit Singh

Total Post:565

Points:2825
Posted by  Amit Singh
Java 
 995  View(s)
Ratings:
Rate this:
  1. Amit Singh

    Post:565

    Points:2825
    What is Singleton class?

    Singleton class is a class whose only one object can be created at a time. - To achieve this one method is that we make its constructor private and provide a static method that returns its instance.

    When a Singleton class is garbage - collected and then reloaded, a new Singleton instance is created.

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!