Hello,
Can somebody help me understand why this code:
giving the following results :
Child
Parent
I understand why the "Child" is appearing - the overridden method "someMethod()" will be invoked and it will use the "s" variable from the Child class. That is why I don't know why the show() method will use the "s" variable from the Parent class in the second case (line 9). The Child object is created and the show() method is inherited by the Child class.
Any help will be appreciated