Set values in arrayList with loop
<pre><code> ArrayList&lt;Rectangle&gt; list = new ArrayList&lt;Rectangle&gt;();
  for (int i=0; i &lt; 10; i++)
  {
  list.add(new Rectangle(10,20));

  }

 for (int i=0; i &lt; list.size(); i++ )
  {
     Rectangle rec = list.get(i);
     System.out.print("Element " + i +"  ");
     System.out.println("x=" + rec.getX()+"   y=" + rec.getY());
  }
</code></pre>

<p>This output gives me:</p>

<pre><code>  Element 0  x=0.0   y=0.0
  Element 1  x=0.0   y=0.0
  Element 2  x=0.0   y=0.0
  Element 3  x=0.0   y=0.0
  Element 4  x=0.0   y=0.0
  Element 5  x=0.0   y=0.0
  Element 6  x=0.0   y=0.0
  Element 7  x=0.0   y=0.0
  Element 8  x=0.0   y=0.0
  Element 9  x=0.0   y=0.0
</code></pre>

<p>I would like to make 10 elements with values 0f 10 and 20 each.</p>
