title: How Do i populate a 2d array with random values
body: <p>I have an assignment to populate the array with random number ranging from 0-9. Then print it out in a rectangular format. I'm already having trouble trying to put random integers in the array. Please point me in the right direction     </p>
  
  <pre><code>import java.util.*;
  public class ThreebyFour
  {
      public static void main (String[] args)
      {
       int values[][] = new int[3][4];
       for (int i = 0; i &lt; values.length; i++) 
       {
          for (int j = 0; j &lt; values.length; j++) 
          {
            values[i][j] = ((int)Math.random());
           System.out.println(values[i][j]);
          }
       }
   }
  }
  </code></pre>