In a language like Java, the scope of a variable is usually determined by the nearest enclosing braces. (There are syntactic exceptions, such as declarations in the initializer of a `for` loop and the header of a method.) Such variables are not accessible outside of their scope.

What about public instance variables? Static scoping rules would say they are local to the class or object. But they are accessible from outside the class. I am teaching beginning students and the scoping rules for instance variables are not so clear-cut.

As a long-time programmer, the difference is obvious to me. What is a good explanation for a first-year Java student?