What is true about has-a and is-a relationships? (Choose two)
A) Instance variables can be used when creating a has-a relationship.
B) Inheritance represents an is-a relationship.
C) Inheritance represents a has-a relationship.
D) Instances must be used when creating a has-a relationship.
Answers: A, B
The is-a relationship is expressed with inheritance and has-a relationship is expressed with composition.
I selected B and D, and D is wrong. Why?
What else other than an instance can be used for HAS-A relationship?
OCPJP 6 - 96%
Currently working on Scala at Knoldus Software