virtualmethod
nounUK /ˈvɜːtʃuəl ˈmɛθəd/
US /ˈvɜːrtʃuəl ˈmɛθəd/
A virtual method is a special instruction in a computer program that can be changed by a more specific version.
The animal class has a virtual method called speak that each animal type can replace with its own sound.
OTHER MEANINGS
2. A method in a base class that a derived class can provide its own implementation for.
The base class declares a virtual method so subclasses can customize the behavior.
3. A function whose actual implementation is chosen at runtime based on the object's type.
Calling the virtual method on a dog object runs the dog's version, not the base version.
4. A placeholder method meant to be replaced by a child class in object-oriented design.
The developer marked the method as virtual to allow subclasses to override it.