Zack Zack - 1 year ago 70
C# Question

Can anyone explain me this specific inheritance syntax?

Can someone explain me this specific syntax in C# ?
I guess this has something to do with Inheritance but I just don't get the syntax with "this" and "new" keywords

public A() : this (new B(), new C())
//Method body


Edit :
I mean, I know this and new keywords but I'm new in C# programming and didn't know this syntax
Thanks all for your answers :-)

Answer Source

It is not inheritance, it calls another constructor of the same class:

public class A
    public A() : this(new B(), new C())

    public A(B b, C c)

See microsoft documentation Using constructors

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download