title: How to randomly select an integer from a list in Java?
body: <p>Here is what I have so far:</p>
  
  <pre><code>private int [] delays = {1000, 1333, 3443, 1220, 3232};
  </code></pre>
  
  <p>I want to have a function where it will sleep for a moment before continuing:</p>
  
  <pre><code>sleep(random(delays))
  </code></pre>
  
  <p>I have found solutions for strings however when it comes to integers I dont really understand it.</p>
  
  <p>I have imported the random. I got:</p>
  
  <pre><code>    Random rand = new Random();
  int delayIndex = rand.nextInt(delays.length);
  </code></pre>
  
  <p>however it says: The method nextInt(int, int) in the type Random is not applicable for the arguments (int)</p>
  
  <p>Thanks for neg repping me. </p>
  
  <p>I appreciate your help however the problem I am geting is still occuring:</p>
  
  <p>The method nextInt(int, int) in the type Random is not applicable for the arguments (int)</p>