What is the result?

Given the classes:

What is the result?

Given the classes:

What is the result?

A.
John Harry

B.
unknown Harry

C.
john unknown

D.
unknown unknown

E.
Compilation fails.

F.
An exception is thrown at runtime.

Explanation:

getName() is missing in John, hence Pupils getName() is invoked and the String in Pupils scope
returned.



Leave a Reply 1

Your email address will not be published. Required fields are marked *