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

In singleton pattern the constructor is not private but
protected.

Go for private constructor when your class has methods which
do not require object creation. ex. (Math class in c#).
Like If your class has all static method, you need not to
create an object in that case go for private constructor.

Is This Answer Correct ?    2 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Define a jagged array in c#?

903


What is int64 in c#?

896


Is it possible to have a static indexer in c#? Allowed in c#.

951


What is the difference between static class and singleton class in c#?

928


What are examples of desktop applications?

967


Is c# 8 released?

900


How many kinds of elements an array can have?

941


Write a program to find the angle between the hours and minutes in a clock

927


What is use of a HashTable in .NET?

1156


What is get set in c#?

976


What is the difference between protected and private?

928


Are cao stateful in nature?

915


Is c and c# the same?

916


Why delegates are type safe?

923


What is yield in c#?

877