In the Java class header, we put B extends A which means B is a subclass of A, if B has all the variables and methods of A (and more). |
In the class definition of B, the child class, there is no need to repeat declarations of variables and methods of A, they are assumed to be there. The definition of B has the additional variables and methods of B. |
Or B may give a new definition of some method of A. This is called overriding. |