Basic HTML version of Foils prepared 19 July 97

Foil 28 Relationships between Classes

From Java Tutorial - Summer 1997 Part II: Java Language and Object-Oriented Concepts CEWES Tutorial -- July 22-25 1997. by Nancy J. McCracken,Geoffrey C. Fox

Account child class definition examples for Foil 28
1 use
  • A uses B: A calls a method (sends a message to) an object of class B or creates, receives, or returns an object of class B.
2 containment
  • A has a B: special case of use - an object of class A contains an object of B
3 inheritance
  • B is a A: specialization - B extends A (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.

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 Wed Apr 1 1998