Passing parameters to the base class constructor

Like this:

public class DerivedClass : BaseClass
{
    public DerivedClass(int derivedParam, String baseParam):base(baseParam)
    {
    }
}

The base keyword here calls the base class constructor that matches the provided parameter overload.

Leave a Comment