previous | index | next

Class Relationships

Name and describe the three common class relationships.

  1. Dependency: a class method has another class type as a parameter or return value, or it constructs an object of another class (a class "uses" another class)
  2. Aggregation (or Association): a class has an instance variable that is another class type or a collection of another class type (a class object "has" an object of another class type as part of its state)
  3. Inheritance: a class is a subclass of another (an object that is an instance of one class "is" also an instance of another)

previous | index | next