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
What is the difference between throw and throws in java?
What are the advantages of functions?
Why synchronization is important?
What interface is extended by awt event listeners?
What is the best definition for data?
Is null a value?
Can we use catch statement for checked exceptions when there is no chance of raising exception in our code?
What is the vector class in java programming?
What is the importance of static variable?
Does java vector allow null?
What is object english?
What are the elements of java?
Why does java doesnt suuport unsigned values?
What is difference between variable declaration and definition?
What is meant by 'Class access modifiers'?