Virtual Methods and Properties

Learn how to customize inherited behavior in C# using virtual methods, property overrides, and the sealed modifier.

When we inherit a method from a base class, we might need to change its behavior in a child class. This ability to provide specific implementations for a general action is a core pillar of polymorphism in C#.

Consider the following example: