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
Do loops c#?
Can we override constructor in c#?
Explain the access modifiers in c#?
How C# 4.0 supports dynamic programming language?
What is wpf c#?
In .NET how can you solve the DLL Hell problem?
What is returned if you pass the value 12.34 to the parsefloat () function?
What is string programming language?
What is the example of predicate?
How do I trim a space in c#?
how to prevent a class from being inherited in c#.net?
Is c# pass by reference?
What is the function of .IsDescendent()?
Between windows authentication and sql server authentication, which one is trusted and which one is untrusted?
How is a loop recorder monitored?