Show( )
.
One other point: Notice that
new
is used in this program to tell the compiler that you
know a new method called
Show( )
is being declared that hides the
Show( )
in
A
.
Creating a Multilevel Hierarchy
Up to this point, we have been using simple class hierarchies consisting of only a base class
and a derived class. However, you can build hierarchies that contain as many layers of
inheritance as you like. As mentioned, it is perfectly acceptable to use a derived class as a
base class of another. For example, given three classes called
Do'stlaringiz bilan baham: |