What is singleton class?
Answer Posted / sathya
Singleton class:
This is a class which can be instatiated only once.
Eg:
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 ? | 242 Yes | 44 No |
Post New Answer View All Answers
What is the purpose of finalization in java programming?
Does anyone still use java?
State two differences between C and Java.
How many bytes is a string java?
What does compareto () do in java?
What is vector?
What's the difference between comparison done by equals method and == operator?
What do you understand by abstract classes?
What is an iterator interface in java programming?
What are the important methods of java exception class?
What data type is true or false?
What is compiler and what its output.
Define reflection.
Explain the difference between hashmap and hashtable in java?
Can a final variable be manipulated in java?