6.4 Inheritance: Packages: Interfaces
should declare them as protected. Accordingly, we have used accessor
methods in Line Nos. 32 and 33 to display these private variables.
Line No. 13: declared public method
ComputeGrade(). Line No. 30 classes it
with std object. Also this method takes std1 object as argument and
returns std1 object.
Line No. 30: calls method belonging to superclass Person :std.DisplayData().
This is the real power of Inheritance. Student1 has not written code
for DisplayData() but it is using the code of super.
6.2.1 Base Class/Super Class
A super class or base class, as it is differently called in the literature, is a class from which other
classes are derived. We can say that other classes extend to a base class.
The classes ...