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

What is generic collection in c#?

0 Answers  


How can you prevent escaping on backslashes in C# with string definitions?

0 Answers   Siebel,


What is default method in c#?

0 Answers  


Explain a MSIL ? Why is it appreciated by all developers?

0 Answers   Siebel,


What will a loop recorder show?

0 Answers  


What is difference between dictionary and list in c#?

0 Answers  


What does Dispose method do with the connection object?

2 Answers  


What is the difference between proc. Sent by val and by sub?

0 Answers  


What is dictionary collection in c#?

0 Answers  


Define c# i/o classes? List the commonly used classes?

0 Answers  


What is default class in c#?

0 Answers  


Which is faster dictionary or hashtable?

0 Answers  


Categories