Thanks for the replies, but bear with me for a minute, I want to make sure I understand why the statement is true. I understand that we can reference the class variable from anywhere in the class using the qualified name "Foo.someVariable" notation, and that if we removed the local variable, it would then be accessible through the simple name "someVariable".
However, looking at the definition of
visible given in the top post, there are two conditions which need to be satisfied, the second being that the declaration "is not shadowed by any other declaration" at that point. According to the same document:
Some declarations may be shadowed in part of their scope by another declaration of the same name, in which case a simple name cannot be used to refer to the declared entity.
Where
A simple name is a single identifier. A qualified name consists of a name, a "." token, and an identifier.
So is it the case that the local variable shadows the class variable at the point where System.out.println() is called? If so then surely, according to the earlier definition, the class variable is no longer visible at that point?