Nidhi Sar wrote:When considering relationships between classes, which statement(s) are true?
A) is-a relationships always rely on inheritance
B) is-a relationships always rely on instance variables
C) is-a relationships always require atleast two class types
D) is-a relationships always rely on polymorphism
E) is-a relationships are always tightly coupled
The answers are A, C & D.
I think answer is D only.
A) is-a relationships *always* rely on inheritance
Always? Actually, is-a relationship rely on Interfaces also (which is NOT inheritance).
For example, C implements I i.e. C is-an I. Where is inheritance in this example?
C) is-a relationships *always* require at least two class types
Always? Actually, "two class type" is NOT a mandatory requirement.
For example, C implements I i.e. C is-an I. In this example there is only one class and it is an example of is-a relationship.
Am I sleeping?
- SE