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
How do you reverse sort a list in java?
Explain the advantages of packages in java?
What is adapter in java?
What is the use of pattern in java?
Is an array a vector?
Is treeset sorted in java?
What is variable and rules of variable?
What is tostring () method?
Can we create object of static class?
What is the difference in between cpp and java? Can u explain in detail?
What is proper subset?
What is an i/o filter?
What is a wrapper method?
What is the size of string?
What does string intern() method do?