title: Java Error unexpected type required: variable; found: value in an ArrayList
body: <p>I am trying to allocate a random ArrayList array with size elements, fill with
  random values between 0 and 100</p>
  
  <p>This is the block that I keep getting the error in</p>
  
  <pre><code>public static ArrayList&lt;Integer&gt; generateArrayList(int size)
  {
      // Array to fill up with random integers
      ArrayList&lt;Integer&gt; rval = new ArrayList&lt;Integer&gt;(size);
  
      Random rand = new Random();
  
      for (int i=0; i&lt;rval.size(); i++)
      {
          rval.get(i) = rand.nextInt(100);
      }
  
      return rval;
  }
  </code></pre>
  
  <p>I've tried the .set and .get methods but neither of them seem to work</p>
  
  <p>I keep getting the error unexpected type required: variable; found: value</p>
  
  <p>It is throwing the error at .get(i)</p>