title: Why do we declare Private variables in Java?
body: <p>I'm confused because all I keep hearing is that private variables in Java are supposed to protect the code or the variable. But if anybody has access to the code, then it makes no difference if it is private, they can still change it. So how is it considered protected when anybody who has access to the code can change it?</p>