Exam 1z0-809 All QuestionsBrowse all questions from this exam
Question 141

Given:

What is the result?

    Correct Answer: D

    When a class implements two interfaces that contain default methods with the same name and parameters, the class must override the default method to resolve the conflict. In this case, the MyClass class overrides the sayHi() method. So, when obj.sayHi() is called, it invokes the overridden method in MyClass, which prints 'Hi MyClass'.

Discussion
Manuel7000

Agree. It was tested

asdfjhfgjuaDCVOption: D

D is the answer.

steefaandOption: D

Answer is D.

lchowenOption: D

Answer is D. You need to override sayHi() since you inherited the same sayHi() method from the 2 interface

SamriddjiOption: D

D. tested