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
As far as security goes, the answer is "not really": determined hackers could get to your private fields and call your private functions with a little bit of reflection; all they need is a JAR with your code in it.
Although hiding "sensitive" information does not make your class more secure, it makes it (along with systems built from it) a lot more maintainable. So this answer is not an excuse for making all members of your classes public.