Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

7
  • I don't think so, the other question asks the difference, this one asks what is happening. Commented May 28, 2015 at 18:05
  • 2
    A Security Manager can be used to prevent access to private properties. Other than that, AFAIK, there isn't a special space for those. It is just a semantic error to access a field that is out of scope. That's why reflection can bypass it - given the Security Manager ain't in the way. Commented May 28, 2015 at 18:05
  • @necreaux not a duplicate Commented May 28, 2015 at 18:06
  • Actually, I do believe final local variables are stored seperatly. Commented May 28, 2015 at 18:07
  • 1
    @jrahhali Java also restricts access at runtime in the JVM (this is to help prevent issues when using the reflection API). Commented May 28, 2015 at 18:25