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
What is appdomain in c#?
Is c++ or c# better?
Is system a class in c#?
What is difference between singleordefault and firstordefault?
What is difference between float and integer?
Which framework is best for desktop application?
Which are the access modifiers available in c#?
If you want to write your own dot net language, what steps you will u take care?
Explain “static” keyword in c#?
What is integer c#?
What is marshalling and what are different kinds of marshalling?
What is the difference between Decorator and Adapter pattern?
What is gac? What are the steps to create an assembly and add it to the gac?
Define delay signing?
How can we sort an array in c#?