Basic HTML version of Foils prepared July 6 99

Foil 31 Inheritance (the subclass relationship)

From Use of Java Language in Computational Science DoD Modernization Users Group Conference Monterey -- June 7 99. by Nancy McCracken, 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 Tue Jul 6 1999