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 java command?
How does final modifier work?
java program that takes a 3 digit number n and finds out whether the number 2^n + 1 is prime, or if it is not prime find out its factors.
what is the use of reference variable
Why do we declare a class static?
Is java is a fully object object oriented language?
What are instance variables?
Difference between overloading and overridding?
what is the reason behind non static method cannot be referenced from a static Context?
What is a war file?
What is the difference between C++ & Java?
78 Answers College School Exams Tests, HAL, SUN, Syntel, TCS, Wipro,
What is private public protected in java?