Tag Archives: parent class

Override a parent class method in C#

One of the coolest features of object-oriented programming is virtual methods. If a parent class declares a method as virtual, a child class can provide a new implementation for the method. When the program calls the method for a child … Continue reading

Posted in classes, OOP | Tagged , , , , , , , , , , , , | 1 Comment

Make an initializing constructor for a child class in C#

An initializing constructor is a constructor that takes parameters to make it easy to initialize an object’s properties. This example shows how to reuse a class’s initializing constructor for a child class. The following Person class has an initializing constructor. … Continue reading

Posted in classes, OOP | Tagged , , , , , , , , , , , , , , | Leave a comment