In C#, if I have an inherited class with a default constructor, do I have to explicitly call the base class’ constructor or will it be implicitly called?
class BaseClass { public BaseClass() { // ... some code } } class MyClass : BaseClass { public MyClass() // Do I need to put ': base()' here or is it implied? { // ... some code } }
You do not need to explicitly call the base constructor, it will be implicitly called.
Extend your example a little and create a Console Application and you can verify this behaviour for yourself: