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...

C# provides a default constructor for me. I write a
constructor that takes a string as a parameter, but want to
keep the no parameter one. How many constructors should I write?

Answer Posted / tsahi

that depends on weather you are writing a class or a struct.
in a class, the first answer given is correct (i.e. two
constructors). in a struct, you cannot write a default
constructor, and you will always have the automatically
generated one, in addition to any other constructor you may
write by your self.

Is This Answer Correct ?    1 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain the use of Mutex in C#?

1019


What can I create with c#?

917


What is the purpose of namespace?

877


Difference between type constructor and instance constructor? What is static constructor, when it will be fired? And what is its use?

1053


Can property be private in c#?

886


Which compiler switch creates an xml file from xml comments in the files in an assembly?

1012


What operators can be used to cast from one reference type to another without the risk of throwing an exception?

907


How to move to a state-related codebase?

1544


How do you declare a variable in c#?

968


When a Static Constructor is called in a Class?

1039


What is the advantage of constructor?

907


What is the purpose of the integer parse method the decimal parse method?

1111


What is different between Boxing and Unboxing?

1019


What are primitive types in c#?

980


What does string format do?

882