title: Java object Random always returns error: "Random.nextInt(int) line: not available"
body: <p>I am currently writing a program for school to test the efficiency of different sorting algorithms. When trying to create arrays of random numbers, the Random object always gives an error.</p>
  
  <p><code>arrays</code> is type <code>ArrayList&lt;ArrayList&lt;Integer&gt;&gt;</code> and is a set of the arrays I test</p>
  
  <p><code>numTrials</code> is type <code>int</code> and is the number of trials per size of array (I am testing different array sizes at different powers of 10)</p>
  
  <p>This is my code to fill the arrays right now:</p>
  
  <pre><code>Random randGen = new Random();
  
  for(int i = 0; i &lt; arrays.size(); i++)
  {
      for(int j = 0; j &lt; Math.pow(10.0, i / numTrials); j++)
      {
          arrays.get(i).set(j, randGen.nextInt(i));
      }
  }
  </code></pre>
  
  <p>I tried seeding as well by calling <code>randGen.setSeed(System.currentTimeMillis())</code> but the error still showed up every time.</p>
  
  <p>Here is a screengrab of the error:
  <img src="https://i.stack.imgur.com/B8Xft.png" alt="Error screengrab"></p>