Function Overriding

Learn about overriding inherited functions

Overriding inherited functions

When a derived class inherits from a base class, it may choose to change some of the inherited functionality. This is called function overriding, since the derived class is overriding the functionality of the base class.

Example

Here’s a simple example to demonstrate this:

Get hands-on with 1200+ tech skills courses.