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 the signature of a method?
Can you change the value of a constant filed after its declaration?
What is the difference between int and int in c#?
What is dictionary class in c#?
What is the use of thread join in c#?
What is ulong in c#?
What are the access modifiers in c#?
Why we use get set in c#?
What are the steps to make an assembly to public?
How does bitwise xor work?
What does public mean in c#?
What is thread safe in c#?
Name some properties of thread class.
What is helper method in c#?
Can a abstract class have a constructor?