Java Reference
In-Depth Information
The output from the program is shown here:
Let's examine this program closely. First, as explained,
area( )
is now part of the
TwoDShape
class and is overridden by
Triangle
and
Rectangle
. Inside
TwoDShape
,