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

Answers were Sorted based on User's Feedback



7. C# provides a default constructor for me. I write a constructor that takes a string as a parame..

Answer / guest

Two. Once you write at least one constructor, C# cancels
the freebie constructor, and now you have to write one
yourself, even if there?s no implementation in it

Is This Answer Correct ?    8 Yes 0 No

7. C# provides a default constructor for me. I write a constructor that takes a string as a parame..

Answer / nilesh chaudhari

Compiler will provide the default constructor when you not
writing any constructor then only. Otherwise if you writes
any parameterized constructor then you have to explicitly
mentioned default constructor because this condition
Compiler will not provide the default constructor.

Is This Answer Correct ?    3 Yes 0 No

Post New Answer

More C Sharp Interview Questions

If all code is written in a try block and write a catch block with Exception type Exception .In that scenario will all the exceptions catched by that catch block? or any exceptions which will not be caught?

3 Answers   Honeywell,


what is the difference between arraylist and hash table using a simple program?

3 Answers   CGI, Polaris, SunGard,


Explain the access modifiers in c#?

0 Answers  


What is a nullreferenceexception and how do I fix it?

0 Answers  


List the two important objects of ado.net and also list the namespaces that are commonly used in ado.net to aid in connection to a database.

0 Answers  






What is cshtml?

0 Answers  


What is parallel foreach in c#?

0 Answers  


What is stringwriter c#?

0 Answers  


Why abstraction is used in c#?

0 Answers  


What is console writeline in c#?

0 Answers  


What does readonly mean in c#?

0 Answers  


How to use nullable types in .net?

0 Answers  


Categories