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

Name few java 8 annotations ?

561


what is method reference in java 8?

550


Explain the scope of a variable.

624


Is java util regex pattern thread safe?

514


What does next mean in java?

531






Does java list allow null?

536


When should I use stringbuffer?

566


What is your platform?s default character encoding and how to know this?

1748


What is package protected in java?

520


what type of questions asked for barclays technologies pune please send urgent

5225


Why java is called not pure object oriented language?

573


What is java util list?

484


How many return statement are allowed in a function?

453


What is an object in java?

553


how are methods defined?

547