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

How to implement an arraylist in java?

689


Explain about main thread in java?

836


What is meant by interface?

757


What is multithreading and its advantages?

779


How do you end a program?

740


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

849


How do you write a conditional statement?

687


Why java is secure? Explain.

751


What is the best definition for data?

696


placement papaers of spring computing technology

1183


How do you compare arrays in java?

685


Is java a security risk?

778


I want to re-reach and use an object once it has been garbage collected. How it's possible?

752


What is the purpose of default constructor?

769


What are the two categories of data types in the java programming language?

698