title: Using an int arraylist for simple addition
body: <p>Working with Eclipse for an Android app, I have declared and populated an integer array:</p>
  
  <p><code>ArrayList&lt;Integer&gt; ptAr = new ArrayList&lt;Integer&gt;();</code></p>
  
  <p>I have it populated with integers, which I verified.  Now I am trying to loop through the array and use the values for simple addition.  I have tried the following (among many other things):</p>
  
  <pre><code>sum += ptAr.get(i) 
  sum += Integer.valueOf(ptAr.get(i))
  sum += ptAr.indexOf(i)
  sum += Integer.valueOf(ptAr.indexOf(i));
  </code></pre>
  
  <p>Every one of the above crashes.  This seems like it should be extremely simple; what am I missing?</p>