How to separate each row in an ArrayList of 1000 numbers with only 20 numbers printed?
<p>currently trying to figure out to how to complete an issue. I wish to print 1000 random numbers but only having 20 number per row printed. Aka, only have 20 numbers in each line printed instead of 1 line of 1000 numbers. </p>

<pre><code>import java.util.*;

public class ArrayListDemo {
    static int pick;
    public static void main(String args[]) {
    // create an array list
    ArrayList&lt;Integer&gt; al = new ArrayList();
    Random rand = new Random();
    for (int j = 0; j&lt;1000; j++){
        pick = rand.nextInt(100);
        al.add(pick);
       if (j == 20){
        System.out.println(" "); 

       } 
    }

    System.out.println(al);

 }
}
</code></pre>