To inherit a class called Car to define a derived class call
To inherit a class called: Car to define a derived class called: Sedan, what will be the first statement in class Sedan? ANS: An interface has been written, you would like to assign a name called: AirPlan, what should he the interface file name? ANS: To implement an interface called: Car, for a class called: Truck, what will be the first statement in class Truck? ANS: To implement an interface called: Car, for a class called: Truck, do you have to implement all empty methods listed? ANS (1): Cycle Yes No To implement an interface, could you implement extra methods as listed in the interface? ANS (1): Cycle Yes No What is the keyword to be used, if you want to invoke the corresponding constructors in the superclass based on the signature of constructor? ANS: Could we call Interface and attract class abstract type because both arc dealing with future implementation of empty method ANS (1): Cycle Yes No
Solution
1.
public class Sedan extends Car{
}
2.
AirPlan.java
3.
public class Truck implements Car{}
4.
Yes we have to implement all the methods listed in interface Car
5.
We can implement extra methods as a part of class which does not have same definition in interface.
We have to implement all the methods define in interface.
6.
super(list of parameters)
7.
Yes because both cannot be instantiated.
