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 a JAR file?
What do you mean by data type?
What is javac used for?
Why do we need data structure in java?
How do you sort a list in java?
What is * argv?
How to check if a list is sorted in java?
What are the two parts of a conditional statement?
Can a hashset contain duplicates java?
Can we rethrow the same exception from catch handler?
How are the elements of a gridbaglayout organized in java programming?
What do you understand by an io stream?
What is the main use of java?
Can we overload final method in java?
Can anonymous class have constructor?