|
How did you get that output. There should be a filed hiding. You use the same filed name on Sub and Super classes and use the same variable name. If you are working on a Java IDE you should notice it.
So, since you use the sup object reference with the Super class you definitely get the result is 100. It never refer the variable a of the class Sub.
Hope it's clear to you.
__________________
Use an appropriate Subject. "Help, urgent!" isn't one. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Has someone helped you? Then you can To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. their helpful post.
Want to make your IDE the best? To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. (Close on September 4, 2008)
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|