title: Java setters and getters
body: <p>I have been struggling with setters and getters in java for quite a long time now. </p>
  
  <p>For instance, if I want to write a class with some information as name, sex, age etc with appropriate set and get methods. Then in a another class I want to test my set and getters with this as a example:</p>
  
  <pre><code>personInfo = myInfo() = new Personinfo("Anna", "female", "17");
  </code></pre>
  
  <p>How do I do that?</p>
  
  <p>I know that I can have a printout like:</p>
  
  <pre><code>public void printout() {
      System.out.printf("Your name is:  " + getName() + 
                " and you are a " + getSex());
  }
  </code></pre>