title: Java toString() not printing the correct variable
body: <p>I have a class like this in Java:</p>
  
  <pre><code>public class Wrapper {
      public static List&lt;Type&gt; list;
  
      @Override
      public String toString() {
          return "List: " + this.list;
      }
  
      public static void main(String[] args) {
          Wrapper w = new Wrapper();
          System.out.println(w);
      }
  }
  </code></pre>
  
  <p>and a class like this:</p>
  
  <pre><code>public class Type {
      private static String name;
  
      public Type(String n) {
          this.name = n;
      }
  
      @Override
      public String toString() {
          return this.name;
      }
  }
  </code></pre>
  
  <p>Instead of getting the name of each item, I get the name of the last item for each item in the array.  Any suggestions?</p>