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 the Difference between Final Class && Abstract Class?
Which is better ascii or unicode?
What is the Scope of Static Variable?
What is the meaning of immutable regarding string?
List some oops concepts in java?
What is a copy constructor in java?
Why do we need wrapper class?
Can a singleton class be inherited?
What is difference between static variable and global variable?
Why packages are used?
What is externalizable?
What is a module function?
What is __ init __ functions?
What is a static method in java?
What is hashing principle in java?