What is a singleton class in Java? And How to implement a singleton class?



What is a singleton class in Java? And How to implement a singleton class?..

Answer / nashiinformaticssolutions

A singleton class is one that can only have one object at a time. The following procedures must be followed in order to implement a singleton class:

Verify that there is only one object in the class.

Allow the item to be accessed globally.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Core Java Interview Questions

What is the function of character?

0 Answers  


Is alive method in java?

0 Answers  


What is I/O Filter?

2 Answers   TCS, WAX,


What does it mean to be immutable?

0 Answers  


What is use of functional interface in java 8? Explain

0 Answers  






What are the 4 types of research methods?

0 Answers  


What is the need to implement Serializable interface (with no methods) for objects which are to be serialized ? We can write our own functionality which writes objects to streams then why we need to implement and tell JVM that which objects can be serialized.

6 Answers   iFlex, Sapient,


How do I remove a character from a string in java?

0 Answers  


How to eliminate duplicates from an array?

6 Answers   ABC, AdMod, Adobe, College School Exams Tests, Patni, Wipro,


How many decimal places is a double?

0 Answers  


What does 0 mean in boolean?

0 Answers  


What are methods?

0 Answers  


Categories