title: Most efficient way to print an ArrayList
body: <p>I'm trying to print an ArrayList with upwards of a couple thousand entries (it has to find all the prime numbers between 1 and 1000000). At the end of the program, I call this method:</p>
  
  <pre><code>println(myArrayList);
  </code></pre>
  
  <p>While this works with only a couple hundred entries, it takes more time to print the array list than to find the primes once there gets to be more entries.</p>
  
  <p>Would it be more efficient to iterate over it? Or to use a different class?</p>