Classes and Objects II
- Contents
- Aggregation
- Returning References to Private Fields
- The
null
Reference - The
this
Reference - Enumerated Types
- Garbage Collection
- The
finalize
Method - Class Collaboration
- CRC Cards
Aggregation
Creating an instance of one class as a reference in another class is call object aggregation.
Aggregation creates a “has-a” relationship between objects.
Book example:
Aggregation in UML Diagrams
Example code: