Originally posted by Jose Botella:
This means this code prints 0 because the compile type of "this" is Test:
Jose:
Wow - if this had been a test question, I would have got it wrong!
I think what threw me off is that I am not used to seeing the same variables that are declared in the superclass, redeclared in the subclass as is in the case above.
So I am not sure what behaviour this would cause.
Anyways, since I plan on inheriting things in the subclass, I rewrote the code to the following:
Your code and information was a real eye opener though!