Which statement is true?

Given:

Which statement is true?

Given:

Which statement is true?

A.
SportsCar must implement methods from TurboVehicle and steerable

B.
SportsCar must override methods defined by car.

C.
SportsCar must implement methods define by convertible.

D.
Instances of car can invoke convertible methods.

Explanation:

To declare a class that implements an interface, you include an implements clause in the
classdeclaration.
By convention, the implements clause follows the extends clause, if there is one.
Here are the some point that must be considered while implementing an interface (or interfaces)
into a javaclass.
A class implementing an interface must either implement all the methods of that interface
otherwise known asthe abstract class.
A class in java may extend at most one superclass because java does not allow multiple
inheritance, by it mayimplement more than one interface. Multiple inheritance in java is achieved
through the interfaces. When aclass implements more than one interface then implement
statement requires a comma- separated list ofinterfaces to be implement by that class.



Leave a Reply 3

Your email address will not be published. Required fields are marked *


Humberto Bañuelos Flores

Humberto Bañuelos Flores

class Car implements TurboVehicle, Steerable {
// Car methods
}
interface Convertible
{
// Convertible methods
}
public class SportsCar extends Car implements Convertible {
}
Car is a class, only methods in convertible must implement.