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


Please Help Members By Posting Answers For Below Questions

What is variable explain with example?

574


What is tree node in java?

530


why not override thread to make a runnable? : Java thread

561


Difference between abstract and concrete class ?

583


What is the method to expand and collapse nodes in a jtree?

612






What is a qualifier in a sentence?

532


What is a boolean flag in java?

571


What do you understand by the term wrapper classes?

547


State differences between C and Java?

669


Explain the selection sort algorithm and state its time complexity?

614


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?

646


What is java literals?

583


What is the difference between notify and notifyall method?

618


What is the destroy method?

592


What is the difference between abstract classes and interfaces?

519