title: Java - set i to start at 0, i < arraylist.size(), i++... get out of bounds error
body: <p>Don't think there's much to say, here's my code</p>
  
  <pre><code>for (int i = 0; i &lt; numFactors.size(); i++) {
      for (int j = 0; i &lt; denFactors.size(); j++) {
          if (numFactors.get(i) == denFactors.get(j)) {
              commonFactors.add(numFactors.get(i));
          }
      }
  }
  </code></pre>
  
  <p>And I get this error</p>
  
  <pre><code>Exception in thread "Thread-4" java.lang.IndexOutOfBoundsException: Index: 4, Size: 4
      at java.util.ArrayList.RangeCheck(Unknown Source)
      at java.util.ArrayList.get(Unknown Source)
      at com.creatif.cubes.Fraction.simplify(Fraction.java:64)
  </code></pre>
  
  <p>Where line 64 is at the if statement. I can't for my life find the problem here.</p>