My code is:
class Foo { public int a=3; public void addFive() { a+=5; System.out.print(\"f \"); } } class Bar extends Foo { public int a=8;
Since you are doing f.a you will get the value of a from the class Foo. if you had called a method to get the value, e.g getA() then you would have gotten the value from the class Bar.
f.a
a
Foo
getA()
Bar