Basic HTML version of Foils prepared June 5 99

Foil 47 Inheritance (the subclass relationship)

From Java Language in the Computer Science Curriculum ADMI Tutorial Duluth Minnesota -- June 3 99. by Geoffrey C. Fox


1 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).
2 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.
3 Or B may give a new definition of some method of A. This is called overriding.

in Table To:


© Northeast Parallel Architectures Center, Syracuse University, npac@npac.syr.edu

If you have any comments about this server, send e-mail to webmaster@npac.syr.edu.

Page produced by wwwfoil on Sat Jun 5 1999