Introduction to OOP | Chapter 16: Overriding : | next | previous | audio | real | text |
In some languages (C++) overriding will only occur if the parent class has declared the method in some special way (example, keyword virtual).
In some languages (Object Pascal) overriding will only occur if the child class declares the method in some special way (example, keyword override).
In some languages (C#, Delphi) overriding will only occur if both the parent and the child class declare the method in some special way.
class Parent { // C# example public virtual int example (int a) { ... } } class Child : Parent { public override int example (int a) { ... } }