What is singleton class?
Answer Posted / akshat maheshwari
A singleton is an class that can be instantiated once, and
only once. This is a fairly unique property, but useful in a
wide range of object designs. Creating an implementation of
the singleton pattern is fairly straightforward - simple
block off access to all constructors, provide a static
method for getting an instance of the singleton, and prevent
cloning.
| Is This Answer Correct ? | 19 Yes | 3 No |
Post New Answer View All Answers
What is the common usage of serialization? What exceptions occur during serialization?
What is polymorphism java example?
Can we call the run() method instead of start()?
How to convert string to char and vice versa?
Can we use a default constructor of a class even if an explicit constructor is defined?
What is the difference between final, finally and finalize()?
How many types of gc are there in java?
This abstract class is correct ? abstract class A { public abstract void Disp(); public abstract void B() { } public absract virtual C() { } }
when you will synchronize a piece of your code? : Java thread
What is the difference between stored procedure & function?
Is arraylist sorted in java?
What is the type of lambda expression?
What is the equal sign?
What is main difference between variable and constant?
What do you mean by compiler?