top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

What is Singleton class in Java and where it is used?

0 votes
283 views
What is Singleton class in Java and where it is used?
posted Sep 3, 2013 by Arvind Singh

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

+1 vote

Singleton is a design pattern meant to give one & only one instance of an object,other objects can get a reference to this instance through a static method.It required because it give advantage in memory management and for garbage collection.Also restricting the number of instances may be necessary for technological or business reasons for example,we may only want a single instance of a pool of database connections.

answer Sep 4, 2013 by Vinay Shukla
...