Engineering Full Stack Apps with Java and JavaScript
Given the following code, which statements are true?
interface Automobile { String describe(); } class FourWheeler implements Automobile{ String name; public String describe(){ return " 4 Wheeler " + name; } } class TwoWheeler extends FourWheeler{ String name; public String describe(){ return " 2 Wheeler " + name; } }
Select 3 options
A. An instance of TwoWheeler is also an instance of FourWheeler.
B. An instance of TwoWheeler is a valid instance of Automobile.
C. The use of inheritance is not justified here because a TwoWheeler is not really a FourWheeler.
D. The code will compile only if name is removed from TwoWheeler.
E. The code will fail to compile.