In your example none. In this case
Employee
's constructor will automatically be called.
However, if you have a constructor with parameters, there is a purpose. Consider the following example:
abstract class Foo
{
protected Foo()
{
}
protected Foo(int number)
{
}
protected Foo(string s)
{
}
}
class Bar : Foo
{
public Bar()
{
}
public Bar(int number)
: base(number)
{
}
public Bar(string s)
{
}
}
If
Foo
does not have a default constructor (in my example it does), its constructor needs to be explicitly called. There will actually be a compiler error if you don't implement
some constructor on
Bar
, and if you don't call the base constructor, there will be an error as well.
Bottom line, if you have a parameterless constructor in your base class, it will be automatically called if you don't explicitly specify it. And if you do not have a parameterless constructor, you
have to call it from your derived class whether you want it or not.