This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
It is because the "start()" method is overriden in class tt. Remember, Invocation of instance methods are determined by the object referred to at runtime. So at runtime it is Class tt object.
If you use the syntax "((t)new tt()).variable", then it will invoke the variable of superclass and not that of subclass. Because the invocation of variables is determined at compile time and not at runtime.
Joined: Feb 28, 2007
I get it now that overriding method will be invoked and decided during runtime based on the object type, rather than the reference type.