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 the prototype design pattern?

814


Can we use an equated value as operands for an MVC ? Reason for the same.

2210


Explain three types of components comprise an application design?

779


Can we make the reference instance non static?

755


What is viper architecture?

774


Which design patterns have you used in your project ?

778


Write the code for a singleton class?

800


Can you explain singleton pattern?

809


Why should we not use singleton pattern?

765


What are the most important software design patterns?

831


What is factory method in design pattern?

763


What are the benefits of the proxy in the design pattern?

757


What is the difference between adapter and facade?

838


What is singleton and factory pattern?

798


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

780