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
Why we use get set in c#?
Can an int be negative c#?
How more than one version of an assembly can keep in same place?
Define boxing and unboxing in c#?
What is meant by unicode characters?
What do you mean by serialization in .NET?
What is private class in c#?
What is type keyword in c#?
What is console readkey in vb net?
Why do we overload constructors?
Can you have an array of arrays?
What is static variable in c#?
How to block a class from being inherited further?
what is a constructor? What is a destructor?
Define delay signing?