Objects Relationship Types
Back to Homepage
Back to Week 3
Containment
- Holds a
- Student holds a laptop
- Member variable of other class
Composition
- Has a
- Plane has an enginer
Inheritance
- is a
- Intern is an employee
- everything the other class has
Method paramter
- uses a
- Test palindrome using stack
Cardinality
- 1:1
- non-pointer
- pointer to 1
- 1:n
- pointer to dynamic array
- 1:k
- fixed-size array or multiple fields
Ownership
- I am responsible for new and/or delete