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 variable explain with example?
What is tree node in java?
why not override thread to make a runnable? : Java thread
Difference between abstract and concrete class ?
What is the method to expand and collapse nodes in a jtree?
What is a qualifier in a sentence?
What is a boolean flag in java?
What do you understand by the term wrapper classes?
State differences between C and Java?
Explain the selection sort algorithm and state its time complexity?
I want to control database connections in my program and want that only one thread should be able to make database connection at a time. How can I implement this logic?
What is java literals?
What is the difference between notify and notifyall method?
What is the destroy method?
What is the difference between abstract classes and interfaces?