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

How do you sort a list in c#?

915


How to Show Message box in Metro Style App?

1084


What can I create with c#?

972


What is winforms c#?

1073


What is Private Constructor? and it’s use? Can you create instance of a class which has Private Constructor?

1033


What is a datacontract?

1017


What’s a strong name?

1067


Is a structure a class?

986


What does void mean in c#?

1037


What is difference between C# and VB.NET?

1256


Is versioning applicable to private assemblies?

1039


What is difference between ienumerable and list?

1055


List the different stages of a thread?

934


Enlist some of the properties of a thread class?

982


What is a property c#?

1093