virtual
The C# modifier for a member that has a working body a derived class may replace with override.
In more detail
Calls to a virtual member are dispatched on the object's real type at run time. Members are not virtual by default in C#, so a base class must opt in to being extended.
Related terms
- override — The C# modifier that declares a replacement for an inherited virtual or abstract member, or for methods such as Equals and ToString.
- abstract — The C# modifier for a class that cannot be created directly, or a member with no body that every derived class must supply.
- virtual dispatch — Choosing which method body to run from the object's real type at run time, not from the declared type of the variable.
Taught in
- Classes, Interfaces, and Object-Oriented C# — Modern .NET Core, C# & Enterprise Microservices