is-a relationships always rely on polymorphism
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.
Santiago Ennis wrote:For example, C implements I i.e. C is-an I. Where is inheritance in this example?
As far as option C is concerned, that one seems wrong to me too as IS-A relationship can be between a class and an interface...
Ankit Garg wrote:
So you mean when a Class implements an Interface, there's no inheritance??
Santiago Ennis wrote:What about option C?
C) is-a relationships always require at least two class types
Inter is abstract; cannot be instantiated new Inter()
Interface is 100% abstract CLASS
rushikesh sawant wrote: polymorphism is obtained through inheritance.