Exam 1z0-819 All QuestionsBrowse all questions from this exam
Question 80

Given:

and

and

What is the result?

    Correct Answer: B

    The result will be 'ab action'. The class Test implements both AbilityA and AbilityB. Despite the default method in AbilityA, the Test class provides its own implementation of the action() method. When the main method creates an instance of Test and calls the action() method through an AbilityB reference, the action() method in the Test class is executed, outputting 'ab action'.

Discussion
ObaltOption: B

Correct answer is B

ASPushkinOption: B

answer : B even if it would be AbilityA x = new Test(); the same answer : "ab action"

mendjijetOption: B

B is correct TESTED

d7bb0b2Option: B

B is correct=> so reference AbilityB ab = new Test(); is pointed to Test and test has method override this is called. In java real objetct (not reference OR TYPE AbilityB ) is pointed to method that is override by subclass

OmnisumemOption: B

Tested: B.

[Removed]Option: B

COmpiles fine. Answer is B

eldonivanOption: B

The c.action(); in the main method calls Test.action() which in the implementation made by the Test class. Answer is: B ab action

tmuralimanoharOption: B

Answer: B

KiKittyKiOption: B

Correct Ans is B.. Tested

StavokOption: E

E is correct The default method action() inherited from AbilityA conflicts with another method inherited from AbilityB

d7bb0b2

THAT IS NOT CORRECT, class implement two interfaces overriding the method, so this method is called