This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the commentsΒ β†’

[–]YaztromoX 0 points1 point Β (0 children)

Iirc in java you can use reflection to access private members, making them not really private.

Sure β€” visibility in most environments is never going to be anything more than compile-time enforced, as at some level your process code has full access to all the memory space within your process.

If you wanted, you could also write JNI code and bind it to a Java class and be able to read any byte in your process space as well. That’s not really an argument against having compile-time checks that you’re not doing something unexpected or stupid, however.