title: Random Number array in Java - want to sort ascending
body: <p>I am creating random number generator in Java as part of program I am writing to learn the language better (come from more C#/C++ background).</p>
  
  <pre><code>    ArrayList&lt;Integer&gt; al = new ArrayList&lt;Integer&gt;();
      Random ran = new Random();
      for(int i = 1; i &lt;= 11; i++)
          al.add(i);
  
  
      for(int i = 0; i &lt; 2; i++)
      {
          ArrayList&lt;Integer&gt; temp = new ArrayList&lt;Integer&gt;();
          int num = al.remove(ran.nextInt(al.size()));
  
          temp.add(num);
          Arrays.sort(temp);
  
          text("\Random Number " + i + " is: " + temp[i]);
      }
  </code></pre>
  
  <p>On arrays.sort(temp) I get a no suitable method error and in my text output function I get array required but java.util.ArrayList found.  Can anyone suggest a better way to sort this random number array into ascending order or see something I am doing wrong currently that could easily be corrected?  Thanks.</p>