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

What is a virtual memory? : Dot net architecture

749


.Net Frame work arch?

1844


how we can fire event in databound column in datagrid without using button?

815


Explain cache? : .NET Architecture

785


What is the difference between l1 and l2 cache? : Dot net architecture

740


Why am I getting an invalidoperationexception when I serialize an arraylist?

707


What is the use of web.config?

858


Explain How to improve the cache performance? : Dot net architecture

736


Name some changes done since version 3.0?

758


Xmlserializer is throwing a generic "there was an error reflecting myclass" error. How do I find out what the problem is?

782


What is a service class?

788


how to change the application name?

1763


Is dim fs as filestreamobject is a managed code? : Dot net architecture

735


How to implement the display in the class printdoc (how to resolve the naming conflict) a: no naming conflicts

869


Can you explain control extenders?

734