Introduction to OOP | Chapter 8: Inheritance and Substitution: | next | previous | audio | real | text |
class GraphicalObject { public: virtual void draw(); // can be overridden };Other languages, such as Object Pascal, require a modifier in the child class that overriding has taken place:
type Ball = object (GraphicalObject) ... procedure draw; override; (* overriding has taken place *) endStill other languages (C#, Delphi) require indications in both parent and child.