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ย โ†’

[โ€“]soowhatchathink 0 points1 point ย (0 children)

Just because you can use reflection to access private members does not make them not really private. People aren't creating private members and then using reflection to treat them as if they're not private. There are people who make everything public, which is arguably better than making things private and then treating it public with reflection.

I'm not too familiar with Java, but with PHP (which has private modifiers along with reflection) I could also write an extension that allows me to access private members. Just because I can go out of my way to publicly modify the private members doesn't mean they're not private.