title: How to sum all the elements of an arraylist
body: <p>So I'm making a GUI where basically the user inputs a series of numbers into an array list and I'm trying to make it so i can get the sum of all the numbers the add in. Here is what I have :</p>
  
  <pre><code>sum = 0;
  for(int i=0; i&lt;numberlist.size(); i++){
      sum += numberlist.get(i);
  }
  Output.setText("The Sum of all the numbers is " + sum);
  }
  </code></pre>
  
  <p>I get an error message that says: </p>
  
  <pre><code>inconvertable types. 
  required : int 
  found: java.lang.string
  </code></pre>