Basic HTML version of Foils prepared Sept 6 1998

Foil 26 Use of Methods Defined in Parent

From Java Tutorial 98-2: Java Language and Object Oriented Techniques CPS606 Fall Semester 1999 -- Sept 7 1999. by Geoffrey C. Fox, Nancy McCracken


If you call a method in a class that was defined in some parent, the compiler has a simple algorithm to find the definition: it searches up the parent/child hierarchy.
Class:
method A
Definition of method
is given in parent
Class:
Class:
Class:
Class:
Object2
Object1
Object1 creates object2
and calls object2.A



© 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 Mon Sep 6 1999