What is a singleton class in Java? And How to implement a singleton class?
Answer Posted / 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 |
Post New Answer View All Answers
What happens if an exception is not handled in a program?
How do you create immutable object in java?
What are the benefits of operations?
explain copyonwritearraylist and when do we use copyonwritearraylist?
What is hashmap and map?
Can a private method of a superclass be declared within a subclass?
What is the difference between private & public & friendly classes?
If a class is declared without any access modifiers, where can the class be accessed?
Similarity and difference between static block and static method ?
Why null value is used in string?
What is meant by design patterns?
Explain the difference between map and flatmap stream operation?
Explain heap sort?
What are the basic interfaces of java collections framework?
Why string is immutable with example?