hi ranchers
how can be the ans is a b c
can any one explain
public 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 correct 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, since TwoWheeler is not a FourWheeler.
d The code will compile only if 'name' is removed from TwoWheeler.
e The code will fail to compile.
------------------------------------------------------------------
$ Velan Vel @
SCJP 1.4 $
You learn From Your Failures, Others Will Learn From Your Success
------------------------------------------------------------------