C# language
can i create two same name constructer in single class.
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
VulpesPosted Jul 6, 2012, 5:40 AM
However, you can have multiple constructors as long as their signatures (i.e. the number and/or type(s) of their parameters) differ from each other.
For example, this class compiles fine:
class MyClass
{
public MyClass()
{
// code
}
public MyClass(int i)
{
// code
}
// other class member declarations
}