I think the result is :15 , 15 Am i wrong, if so pls make it clear to me? Thank in advanced
posted 15 years ago
The answer is 15 and 5. The cast you have made here ((A)bobj))is equivalent to assigning a base class reference to a superclass type. Hence the i in the superclass gets invoked. Do take a look at this modified code and run it...it might help.