<p><i><font size="3"><b>Overriding base class

<p><i><font size="3">A derived class can declare a method to override a method
in its base class. The method declaration in the derived class must exactly
match the method in the base class in order to override it. That means it must
have the same return type, name, arguments and the const keyword if it has been


<p><i><font size="3">Care must be taken when overriding base class methods to
avoid unintentionally hiding overloaded methods - a single overriding method in
a derived class will hide all overloaded methods of that name in the base


<p><i><font size="3">For instance, the base <b>Mammal </b>class, listed below,
contains two overloaded methods named walk. These require no argument and one
argument respectively. The derived Cat class, listed on the opposite page,
creates an overriding method named <b>walk</b>, with no arguments. This hides
both <b>walk </b>methods in the base

<p><i><font size="3">Additionally the <b>Cat </b>class contains a method named
<b>speak </b>that will override the method of the same name in the <b>Mammal
</b>base class whenever it is called from the main

<p><i><br>