Content deleted Content added
Removed section by SyedHC: redundant explanation of what's already explained in the "Abstract classes" section, but poorly written and incomplete, and placed ahead of more fundamental concepts, and using self-published blog as a source. |
Tags: Mobile edit Mobile web edit Advanced mobile edit |
||
Line 10:
The concept of the virtual function solves the following problem:
In [[object-oriented programming]], when a derived class inherits from a base class, an object of the derived class may be referred to via a [[Pointer (computer programming)|pointer]] or [[Reference (computer science)|reference]] of the base class type instead of the derived class type. If there are base class methods overridden by the derived class, the method actually called by such a reference or pointer can be bound (linked) either
Virtual functions are resolved
Virtual functions allow a program to call methods that don't necessarily even exist at the moment the code is compiled.{{Citation needed|date=October 2021}}
|