What is singleton class?

Answer Posted / abhijith thette nagarajan

As per the definition,Singleton class in one such class
which will have only one instance of it at any given point
of time...

But,it is allowed to any number of instances,not
necessarily be one..

Generally its contructor will have "protected" key work,no
problem also if we have private also,but if it is
private,we need to have a getter method to create an
instance...

Is This Answer Correct ?    34 Yes 20 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why a dead thread occurs?

578


What is the difference between math floor and math round?

505


What is a method declaration?

519


Can we override constructor in java?

581


What is literal example?

566






How do you add an element to an arraylist in java?

492


What is the difference between the paint() and repaint() methods?

591


What is the static keyword?

592


What are identifiers in java?

577


What is the use of static methods?

593


How do you create a bulleted list?

569


Are primitives objects?

566


How does class forname work in java?

487


Why runnable interface is used in java?

578


How many classes can any class inherit java?

512