Learning Java I was sometimes taught to use the private
access modifier so as not to expose \"sensitive information\" to other classes, as if this could open a legi
No, they are not more "secure" in that sense, though some (very poor) books on Java try to explain private
in that way. If an attacker had the ability to cause arbitrary Java code to be run in your process, all "security" is already gone. And as another answer already mentioned, reflection can bypass the private
access modifier.