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



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

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

More Dot Net AllOther Interview Questions

Explain difference between inprocess vs out process session state? : .NET Architecture

0 Answers  


What size is a .net object?

0 Answers  


I am working with asp.net 2005 and Crystal report 10. I have an image field on my dataset to show on Crystal report.And the image is shows dynamically from database in image field of CR. The image field is showing well on my Crystal report on its first page with all other data but when i click to open second page of CR,it does not show any data on that.I found that this is because of adding the image field on crystal report. Because when i remove the image field from the CR then it will run both the pages of CR. I am using the Page Load event to bind CR data with Database. And i have already check with the Init event to bind CR , but it still not shows the data on second page when i use image field on that. Please give solution for that.....

0 Answers  


Explain difference between state server and sqlserver? : .NET Architecture

0 Answers  


which would be the best to use inproc,outproc or sql server

2 Answers   Ness Technologies,






Does application frame need host?

0 Answers  


What is the difference between an event and a delegate?

0 Answers  


Hi i need fast track course maximum to complete within a month....courses are Asp.net,c3,vb.net n sql server........at hyderbad location ..best institute n cost

1 Answers   Chevron,


How to improve the cache performance? : .NET Architecture

0 Answers  


Explain what does the term "green architecture" mean? : Dot net architecture

0 Answers  


How can a win service developed in .NET be installed or used in Win98?

1 Answers  


2. I've a class Parent Class A and a Derived Class B. Here is a scenario. I've an instance of Class A as objA and an instance of Class B as objB. I can refer a child class variable as objB=objA, but cannot do objA=objB what is the reason?

2 Answers   247Customer,


Categories