The parameterless base constructor will be called implicitly unless you explicitly call a paramterized base constructor.
If you have
class Base { }
class Foo : Base { public Foo() { } }
It is no different from saying
class Foo : Base { public Foo() : base() { } }
So if you have a parameterized constructor for Foo, base()
will be called no matter what you do with this()
unless you also have a parameterized constructor for Base
that you explicitly call.
class Base
{
public Base() { }
public Base(int bar) { }
}
class Foo : Base
{
public Foo() : base() { }
public Foo(int bar) : base(bar) { }
// also legal:
// public Foo() : base(1) { }
// public Foo(int bar) : base(1) { }
// public Foo(int bar) : base() { }
// public Foo(int bar) { } /* uses implicit call to base() */
// public Foo() { } /* ditto */
}
Either way, the base class will get instantiated first either through the parameterless constructor (implicitly or explicitly) or through the parameterized constructor (explicitly).