Answer Posted / ravi
Make the constructor private
provide a static synchronized method to get the Instance.
this should make the object singleton for that jvm instance
| Is This Answer Correct ? | 3 Yes | 0 No |
Post New Answer View All Answers
Is dependency injection a design pattern?
Why singleton beans are not thread safe?
What is the prototype design pattern?
Shall we use abstract classes or interfaces in policy / strategy design pattern?
What are the most important software design patterns?
Is bean a singleton?
Write the code for a singleton class?
Explain what is good design?
What is clean architecture?
Are singletons bad?
What are structural design patterns?
Using any system, product, or service your organization provides, identify the human system roles for the product.
What is the builder pattern?
Why do we need singleton pattern?
What is the design pattern?