What is a singleton class in Java? And How to implement a singleton class?
Answers were Sorted based on User's Feedback
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 |
Answer / nashiinformaticssolutions
A class that can possess only one object at a time is called a singleton class. To implement a singleton class given steps are to be followed:
1. Make sure that the class has only one object
2. Give global access to that object
| Is This Answer Correct ? | 0 Yes | 0 No |
What happens when a main method is declared as private?
22 Answers DELL, Infosys, L&T, Sun Microsystems,
What is import java util arraylist?
What is a 16 bit word?
what is encapsulation in java? Explain
Explain jdk, jre and jvm?
What are heap memory and stack memory and what are memory tables.
What is files manifesting?
How do you define a singleton class?
What does int [] mean in java?
Is java a utf 8 string?
What is the full name of java?
what is the diff between Servletcontext and servletconfig?