Question: java QUESTION 1: An interface supports multiple inheritance True False QUESTION 2: An abstract class can have final, non-final, static and non-static variables. True False
java
QUESTION 1: An interface supports multiple inheritance
True
False
QUESTION 2: An abstract class can have final, non-final, static and non-static variables.
True
False
QUESTION 3: An interface can have final, non-final, static and non-static variables.
True
False
QUESTION 4: An abstract class can have static methods, a main method, and a constructor.
True
False
QUESTION 5: An interface can have static methods, a main method, and a constructor.
True
False
QUESTION 6:An abstract class can provide the implementation of an interface.
True
False
QUESTION 7: An interface can provide the implementation of an abstract class
True
False
QUESTION8: A class Car and its subclass ElectricCar both have a method accelerate() which was written by the programmer as part of the class definition. If TeslaModelS refers to an object of type ElectricCar, what will the following code do?
A.TeslaModelS.accelerate();
| B. | The accelerate() method defined in ElectricCar will be called. | |
| C. | The accelerate() method defined in Car will be called. | |
| D. | The compiler will complain that accelerate() has been defined twice. | |
| Overloading will be used to pick which accelerate() is called. |
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
