What is singleton class?

Answer Posted / nagarjuna

Singletonclass is a class which can be instantiated only once.
public class Singleton
{
private static single = new Singleton();

Private Singleton();
{}
}

For a singleton class, the constructor is made private and
a static variable is used for instatiating the class.

Is This Answer Correct ?    4 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is difference between equal and == in java?

526


What is the functionability stubs and skeletons?

684


Can the garbage collection be forced by any means?

534


Why is sizeof not a function?

551


What are the two main uses of volatile in Java?

605






Is string is a class in java?

525


Write a program to show whether a graph is a tree or not using adjacency matrix.

598


How to perform quicksort in java?

573


How destructors are defined in java?

632


What are the restrictions that are applied to the java static methods?

532


Is it safe to install java on my computer?

544


What is java basic concept?

527


what type of questions asked for barclays technologies pune please send urgent

5232


Is static a singleton?

527


What do you understand by the term wrapper classes?

546