Given:
What is the result?
Given:
What is the result?
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'.
Ans is B. Tested
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)
Answer is c tested
You must have a typo in your code
Answer is B. Methods are correctly overridden and methodB from Daze class is called since that is actual object.