title: Converting ArrayList to 2D array
body: <p>After figuring out a way pof create of list of random numbers from 1 to 16, how can I display this list in matrix form.</p>
  
  <pre><code> public static void main(String... args) throws Exception {
  
   List&lt;Integer&gt; list = new ArrayList&lt;Integer&gt;();
   for (int i = 1; i &lt; 17; i++) {
      list.add(i);
  }
  System.out.println(list); //[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]
  Collections.shuffle(list);
  System.out.println(list); //[11, 5, 10, 9, 7, 0, 6, 1, 3, 14, 2, 4, 15, 13, 12, 8]
  
  int[][] a2 = new int[4][4];
  for (int i = 0; i &lt; 4; i++) {
      for (int j = 0;  j&lt; 4; j++) {
  
  
          a2[i][j] = list.get(i*4 + j);
        //  System.out.println(Arrays.deepToString(a2)); //[[11, 5, 10, 9], [7, 0, 6, 1],     [3, 14, 2, 4], [15, 13, 12, 8]]
      }
     System.out.println(Arrays.deepToString(a2)); //[[11, 5, 10, 9], [7, 0, 6, 1], [3,     14, 2, 4], [15, 13, 12, 8]]
  }
  //System.out.println(Arrays.deepToString(a2)); //[[11, 5, 10, 9], [7, 0, 6, 1], [3, 14                  2, 4], [15, 13, 12, 8]]
  }
  </code></pre>
  
  <p>Like this :<br>
      3, 4, 5, 8,<br>
      2, 6, 7, 9,<br>
      11, 1, 15, 13,<br>
      10, 12, 14, 0  </p>
  
  <p>I put a zero at the end because I want it to present a void that can be moved by the user, using boolean operators.</p>