Leave a Reply 5

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


Fredy Benavides

Fredy Benavides

a. unknown Harry

Pavel

Pavel

C – variable name is the same but cannot be. Name was declare in Pupil.

leo yu

leo yu

tested it, correct answer is F.

the modifier of name of Pupil is package private.
during compilation, compiler retrieved the p1.name of Pupil instance in that p1 is the Pupil type, the member method getName is virtual and runtime would dynamicaly link it to the correct Object method, here is the Pupil’s getName.

during compilation, compiler retrieved the p1.name of Pupil instance in that p1 is the Pupil type, the member method getName is virtual and runtime would dynamicaly link it to the correct Object method, here is the Harry’s getName.

YR

YR

A:unknownHarry!! (tested)

Dylan

Dylan

+1. A, tested!