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
How we can generate random numbers in java?
Why java applets are more useful for intranets as compared to internet?
What is bean? Where it can be used?
What does jenkins do?
Which sorting algorithm is best in java?
What is the default size of load factor in hashing based collection?
Is null an object java?
Does treeset use compareto?
What is numeric function?
What are the advantages of java?
Explain the differences between abstraction and encapsulation?
What does string [] args mean?
What do you understand by the term string pool?
how can you take care of mutual exclusion using java threads? : Java thread
Why null value is used in string?