Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Constructor overloading
Message
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Environment versions
Environment:
C# 2.0
Miscellaneous
Thread ID:
01226186
Message ID:
01226192
Views:
20
class MyClass
{
  public MyClass(int age):this(age, true){}

  public MyClass(int age, bool alive)
  {
    // do stuff
  }
}
Hmmm I knew I should have known how to do that <s>

>Can I do something similar to this:
>
>class MyClass
>{
>  public MyClass(int age)
>  {
>    MyClass(age, true);
>  }
>
>  public MyClass(int age, bool alive)
>  {
>    // do stuff
>  }
>}
>
>
>This doesn't compile but I think my intentions are clear.
>I am having a hard time thinking clear any help would be appreciated.
>
>Thanks,
>Einar
Semper ubi sub ubi.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform