title: Printing all variables value from a class
body: <p>I have a class with information about a Person that looks something like this:</p>
  
  <pre><code>public class Contact {
      private String name;
      private String location;
      private String address;
      private String email;
      private String phone;
      private String fax;
  
      public String toString() {
          // Something here
      }
      // Getters and setters.
  }
  </code></pre>
  
  <p>I want <code>toString()</code> to return <code>this.name +" - "+ this.locations + ...</code> for all variables. I was trying to implement it using reflection as shown from <a href="https://stackoverflow.com/questions/850148/accessing-java-static-final-ivar-value-through-reflection">this question</a> but I can't manage to print instance variables.</p>
  
  <p>What is the correct way to solve this?</p>