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.
Someone helped you? their helpful post.