title: print out an array list of custom objects made from own class in java
body: <p>I am trying to print out a customer array list. I have created a customer class as well.
  It's initialized by this</p>
  
  <pre><code>    List&lt;Customer&gt; listOfCustomers = new ArrayList();
      Customer customer = new Customer(customerLicense);
  </code></pre>
  
  <p>I then add a date, amount paid, expiration time to the customer then add the customer to the list</p>
  
  <pre><code>    listOfCustomers.add(customer);
  </code></pre>
  
  <p>I've tried a few different ways of printing it, but this got me the farthest. </p>
  
  <pre><code>    Object[] newListCustomers = listOfCustomers.toArray();
      Arrays.asList(newListCustomers).toArray(new String[newListCustomers.length]);
      for (int customerNumber = 0; customerNumber &lt; newListCustomers.length; customerNumber++) {
          System.out.println(newListCustomers[customerNumber]);
      }
  </code></pre>
  
  <p>it gives an error <code>"Exception in thread "main" java.lang.ArrayStoreException"</code> on the line with the <code>Arrays.aslist()</code> function. Is there a better and easier way to print it?</p>