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

What are the files generated after using IDL to java compiler?

578


If you do not want your class to be inherited by any other class. What would you do?

555


Explain the init method?

531


What are the difference between composition and inheritance in java?

504


What are the three best choices for a development environment?

589






Differentiate jar and war files?

582


How do you sort arrays in java?

516


What does method mean?

504


Program to Find the second largest element in an array.

578


Which class is the superclass of all classes?

592


What are heterogeneous objects?

560


which pattern is default in scanner package?

1790


List out five keywords related to exception handling ?

594


Can you sort a string in java?

480


Can private class be inherited in java?

540