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

Is mvc a software design pattern?

671


Write the code for a singleton class?

620


What are the examples of the behavioral design patterns?

601


Contact a small, medium, and a large contract program within your organization. Interview the Technical Director or Project Engineer to identify the following information: a. Request the individual to graphically depict their development strategy? b. What factors drove them to choose the implementation strategy? c. What were some of the lessons learned from developing and implementing the strategy that would influence their approach next time? d. How was the V & V strategy implemented?

2392


when performing a functional test on a phone calculator,if pressing on a button does not function what do i do next

6835






What is the factory pattern in the design pattern?

743


When singleton pattern is used?

601


what is the lazy design pattern?

606


What are the most commonly used design patterns?

604


Is singleton bean thread safe?

562


Which design pattern is mostly used in net?

578


Give me example of chain of responsibility design pattern?

623


Quartus II software version 6.0 is available for which operating systems (OS)?

1921


What are the 23 design patterns?

720


What is the difference between builder and composite?

614