Given the following class declarations: Which answer fails to compile?
A.
Option B
B.
Option C
C.
Option D
D.
Option E
E.
Option A
Given the following class declarations: Which answer fails to compile?
A.
Option B
B.
Option C
C.
Option D
D.
Option E
E.
Option A
d
CAN ANY ONE GIVE CORRECT EXPLANATION TO THIS QUESTION
Option D is the correct answer
Definitely C -Option D.
Any class that inherits directly or indirectly has a IS-A relationship with the super class.
So;
Tiger IS-An Animal…..because it extends Cat which extends Animal.
Cat IS-A Hunter……..because it implements Hunter.
Tiger IS-A Hunter………because it extends Cat which implements Hunter.
Cat IS-NOT a Tiger……..because it doesn’t inherit from it.
Cat IS-An Animal…….because it extends Animal.
Hope this helps.
c