We're a place where coders share, stay up-to-date and grow their careers.
I think it's 1, and it's because the object is always of type ChildOfSuperType no matter what type you store it in, so when the method is dispatched it will always resolve to the version on ChildOfSuperType.
ChildOfSuperType
/me goes to check.
Spoiler here for anyone wondering what the answer is: repl.it/@samwho/KnownEnormousWeara...
I think it's 1, and it's because the object is always of type
ChildOfSuperType
no matter what type you store it in, so when the method is dispatched it will always resolve to the version onChildOfSuperType
./me goes to check.
Spoiler here for anyone wondering what the answer is: repl.it/@samwho/KnownEnormousWeara...