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

Given:

What is the result?

    Correct Answer: A

    When the code is executed, the `Daze` class instance calls the `methodB` method. This method first calls `methodB` on its `Bar` field which prints 'Bar Hello'. Then it calls `super.methodB(s)`, which, given that `Daze` extends `Baz`, calls the `methodB` in the `Baz` class. Inside the `Baz` class, the `methodB` method is overridden and starts by printing 'Baz Hello'. However, since `Baz` extends `Bar`, it inherits the `methodB` from `Foo` which prints 'Foo Hello'. Therefore, the output should be 'Bar Hello Foo Hello'.

Discussion
Manuel7000Option: B

Ans is B. Tested

shivkumarxOption: B

Answer is B, also tested The daze instance calls methodB in the Daze class which calls methodB in the Bar class (via its Bar field), then methodB in the Baz class (via super)

asdfjhfgjuaDCVOption: C

Answer is c tested

shivkumarx

You must have a typo in your code

steefaandOption: B

Answer is B. Methods are correctly overridden and methodB from Daze class is called since that is actual object.