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 |
Is oop a design pattern?
how to pring 10 item per page in smartform
What are the examples of the behavioral design patterns?
Quartus II software version 6.0 is available for which operating systems (OS)?
What is the publish/subscribe model?
Is singleton an anti pattern?
Give me example of observer design pattern?
What is a pattern library?
Why have we declared the instance reference volatile?
What are the advantages of thin clients?
Why should we not use singleton pattern?
write 5 best test cases like any password?password should be mixed case with atlest one number or special characters?