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?

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

What are callback methods in c#?

504


What is Web.config?

543


Define Final Class in C#

544


Are value types sealed?

511


What floating point types is supported in C#?

592






What does this keyword mean in c#?

519


What is class and object c#?

485


What is boxing & unboxing?

568


What is the difference between read and readline in c#?

476


Which function is the entry point for a DLL in MS Windows 3.1?

681


Can constructor have return type c#?

636


What are bitwise logical operators?

481


For methods inside the interface why can’t you specify the accessibility modifier?

547


What is fcl in c#?

489


What are custom exceptions in C#?

550