Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

What is a private constructor? where will you use it?

Answer Posted / nevin jain

In singleton pattern we make the class sealed n keep
contractor as protected
......which is same as keeping class with any access
modifier with private constructor..

both pattern is the example of singleton pattern..
basically this pattern say that only single instance can be
created of the class which can be achieved either by private
constructor or sealed class with protected constructor..

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is interface used in c#?

960


What is int16?

869


What happens if a static constructor throws an exception?

885


Different between method overriding and method overloading?

922


hi all.... i need code snippets for store and retrive tiff fromat images in sqlserver....... kindy provide it.......

1780


What is the difference between method and constructor in c#?

997


What is object type in c#?

905


Why do I get a security exception when I try to run my c# app?

944


What do you mean by hashtable c#?

951


What are strongly typed objects?

868


What is the difference between class and namespace?

914


Is c# int immutable?

862


What is cls, cts and clr in net?

849


What is the difference between list and arraylist c#?

958


What is difference between a type and class?

1064