How can i create only one instance of class and thus doesn't
allow creating any more instances?

Answer Posted / prayag thakkar

If a system only needs one instance of a class, and that
instance needs to be accessible in many different parts of
a system, you control both instantiation and access by
making that class a singleton.

Is This Answer Correct ?    5 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why the config file might not be writable

569


What's new in the .net 2.0 class library?

541


Explain the number or character entered through keyboard gets converted to equivalent ascii code & it get stored on ram in the binary form.

522


Is .net easier than java?

523


What is cache coherency and how is it eliminated? : .NET Architecture

528






where should I put this information then?

587


How do I know when my thread pool work item has completed?

498


Explain difference between machine config vs. Web config? : .NET Architecture

541


What is a managed code? : Dot net architecture

558


Explain COM with example?

564


State the different levels of exceptional safety?

571


What is difference between .net and visual studio?

518


What is msil, and why should my developers need an appreciation of it if at all?

537


Differnce between managed code and unmanaged code ?

526


How to improve the cache performance? : .NET Architecture

554