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
How would overload a function based on return type?
What does @override mean?
Where we write javascript code in html page?
Why destructor is not used in java?
What are green threads in java?
Is empty list java?
What are daemon Threads in java?
What are the different types of sorting in java?
What is the use of flag?
What is pangram in java?
explain local datetime api in java8?
How to overcome the exception object reference not set to an instance of object?
Why declare Main() inside the class in java ?
What is files manifesting?
What's the difference between int and integer in java?