title: Why can I change a private attribute out of its class?
body: <p>I code on Processing for a few months now and I'm trying to use java classes. I'm a newbie on java classes and I believe that private attributes of a class cannot be modified outside this class.
  However I did change a private attribute of an object in Processing's <code>setup()</code> void. I don't understand why I am able to do that.
  Can anybody help me ?</p>
  
  <p>A part of the class code:</p>
  
  <pre><code>public class Character {
    private String name;
    ...
  
    public Character(String pName, ...) {
      name = pName;
      ...
  
    public void dname() {
      println(this.name);
    }
  }
  </code></pre>
  
  <p>The <code>setup()</code> code:</p>
  
  <pre><code>void setup() {
    player = new Character("John Doe", ...);
    player.dname();  //I get "John Doe".
    player.name = "tara"; 
    player.dname();  //I get "tara", without any error.
  }
  </code></pre>
  
  <p>Thank you very much !</p>