title: How can I output the contents of an arraylist in java?
body: <p>I'm trying to output an arraylist in the following line of code, but I only receive something like this Employee@160eaab5</p>
  
  <pre><code>public class Company {
      static ArrayList &lt;Employee&gt; list1 = new ArrayList &lt;Employee&gt; ();
      public static void main() {
          list1.add (new Employee ("John", "Smith", 11.0));
          list1.add (new Employee ("James", "Bond", 7.0));
          list1.add (new Employee ("Fabio", "Jones", 6.9));
          list1.add (new Employee ("Simon", "Geeha", 10.0));
          output();
      }
      public static void output() {
          System.out.println("First Name\tLast Name\tSalary in thousands of dollars");
          for (int x = 0; x &lt; list1.size(); x++) {
              System.out.println ((Employee) list1.get(x));
          }
      }
  }
  </code></pre>
  
  <p>The class below provides the constructor and fields for the arraylist above.</p>
  
  <pre><code>public class Employee {
      public String first;
      public String last;
      public double money;
  
      public Employee (String s1, String s2, double s3) {
          first = s1;
          last = s2;
          money = s3;
  
  
      }
  
   }
  </code></pre>