← Quiz: Inheritance: all 10 questions
Quiz: Inheritance · Question 9 of 10
In Java, two interfaces both provide a default method start(), and a class implements both. What must the class do?
In Java, two interfaces both provide a default method start(), and a class implements both. What must the class do?
- A.Override start() itself to resolve the conflict
- B.Nothing; the first interface wins
- C.Nothing; the second interface wins
- D.It cannot implement both interfaces
Answer & explanation
Correct answer: Override start() itself to resolve the conflict
Java forces you to settle the diamond ambiguity explicitly.
Can you get the rest right without peeking?
Take the timed Quiz: Inheritance quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →