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
In java, what is the difference between method overloading and method overriding?
How do you sort in ascending order in java?
Describe what a thread-local variable is in java?
Distinguish between a predicate and a function?
What are the two main uses of volatile in Java?
What is meant by polymorphism?
What is bufferedreader in java?
What is final modifier?
How do I enable java in safari?
What are different types of inner classes ?
Can a final variable be manipulated in java?
Addition to previous section relative word 5th one was Putrid ans: rotten, also there was prob. in 1st section on bucket weight ans:10kg, also there was a prob. on train speed to find bridge length ans:800 mtrs.
What is the difference between equals() and?
What is the main function in java?
Why java is considered dynamic?