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 is an escape character in java?
What is the difference between throw and throws? What is the similarity between try and throw?
What is comparable and comparator interface? List their differences
Do loops java?
Can each java object keep track of all the threads that want to exclusively access it?
For technical interview question please sir send me because tomorrow my interview
how come we know the object is no more used in the class?
what is the purpose of the runtime class?
Why put method is used?
What is jagged array in java?
What is the use of http-tunneling in rmi?
What is application system?