Question
Given these three definitions
interface I1 {}
interface I2 {}
abstract class C {}
which one of the following will compile without errors?
- a) class Main extends C, I1, I2 {}
- b) class Main implements C extends I1, I2 {}
- c) class Main implements C, I1, I2 {}
- d) class Main extends C implements I1, I2 {}
- e) class Main extends C implements I1 implements I2 {}
- f) class Main implements C extends I1 extends I2 {}
d)
Note
A class inherits another class using the extends keyword and inherits interfaces using the implements keyword.
PreviousNextRelated