class Person
{
public int age;
public Person()
{
age = 1;
}
}
class Customer : Person
{
public Customer()
{
age += 1;
}
}
Customer customer = new Customer();
Would the age of customer be 2? It seems like the base class's constructor will be called no matter what. If so, why do we need to call base
at the end sometimes?
public Customer() : base()
{
.............
}