Java OCA OCP Practice Question 3102

Question

Given these two definitions

interface I1 {}
interface I2 {}

which one of the following will compile without errors?

  • a) interface Main implements I1, I2 {}
  • b) interface Main implements I1 implements I2 {}
  • c) interface Main implements I1 extends I2 {}
  • d) interface Main extends I1, I2 {}


d)

Note

It is possible for an interface to extend one or more interfaces.

In that case, we need to use the extends keyword and separate the list of super-interfaces using commas.




PreviousNext

Related