HELP! * YELLOW=global GREY=local Global HTML version of Foils prepared 1 February 97

Foil 12 Relationships between Classes

From Jan 27 Delivered Lecture for Course CPS616 -- Java Lecture 2 -- Basic Applets and Objects CPS616 spring 1997 -- Jan 27 1997. by Nancy McCracken * See also color IMAGE
Secs 138.2
use
  • A uses B: A calls a method (sends a message to) and object of B or creates, receives, or returns an object of B.
containment
  • A has a B: special case of use - an object of class A contains an object of B
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, 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.


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 Sun Feb 16 1997