How can we design/implement singleton object?

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a lazy initialization in singleton?

594


Which design pattern is mvc?

622


What is meant by design pattern?

575


What are the disadvantages of singleton pattern?

582


Write the code for a singleton class?

618






What is the use of repository pattern?

574


When singleton pattern is used?

597


What is the concurrency design pattern?

705


Are you using singleton in your code?

589


Which design patterns have you used in your project ?

565


What is the prototype design pattern?

626


What are structural design patterns?

603


What is difference between function oriented design and object oriented design?

590


5.Develop an entity relationships diagram that identifies physical entity relationships.

2440


What is the difference between adapter and facade?

626