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 difference between inheritance and encapsulation?
What are autoboxing and unboxing? When does it occur?
Explain the importance of thread scheduler in java?
What if constructor is protected in java?
What are loops in java?
Why do we override tostring method in java?
What do you mean by ordered and sorted in collections in java?
Explain the features of interfaces in java?
What is pre increment and post increment in java?
Explain aggregation in java?
What are constants?
What is difference between next () and nextline () in java?
Why is logger singleton?
What is the meaning of flag day?
What is a methodologist?