How can we design/implement singleton object?
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / jayashri
by declaring the constructor as private and we have to create public static method which returns the address of single object.
Is This Answer Correct ? | 0 Yes | 0 No |
what are design patterns..?what design patterns used in .net.
Is singleton scope thread safe?
What are actually Model,view,Controller in MVC Pattern?
what is MVC Pattern?
What are the benefits of the proxy in the design pattern?
What is a lazy initialization in singleton?
In which application lifecycle phases is an application architecture produced?
What is a behavioral design pattern?
What is the use of such a class?
What is onion architecture?
What is grouping in CSS?
what is data access layer?