title: Select a random value from an Array
body: <p>I have an Array of number values, and I want to randomly select a value from in that array and then insert it in to an <code>int</code> variable.  </p>
  
  <p>I'm not sure what code you will need to see. So, </p>
  
  <p>Here is the <code>for</code> loop that I'm using to generate 13 numbers (1-13) and insert them in to the Array. </p>
  
  <pre><code>    int clubsArray []; 
      clubsArray = new int [13]; 
  
      for(int i = 0; i &lt; clubsArray.length; i++) { 
  
          clubsArray[i] = i +1; 
  
      }
  </code></pre>
  
  <p>That works fine, but now I need to select for example 2 random values from in that array (and then insert it in to a variable to be used later on.</p>
  
  <p>I've looked around on many websites and I've seen things like <code>ArrayList&lt;String&gt;</code> in order to insert values in to an Array and then use <code>Random generator = new Random()</code> to select the value from the array and then <code>.remove()</code> to remove it from the array. But when ever I have used that it doesn't work.  </p>