title: Sum of an arrayList
body: <p>I'm trying to make an average (moy) of an arrayList's column but I need to sum it first, I don't know how to do it</p>
  
  <pre><code>    int sumX = 0;
      val = new ArrayList&lt;&gt;();
      float moy[] = new float[3];
  
            if (i &lt; 100) {
                      val.add(sensorEvent.values);
                  i++;
              } else {
                  for (; i &gt; 0; i--);
                  {
                      sumX = ?
                      moy[0] = sumX/100;
                  }
                  val.clear();
                  i = 0;
  }
  </code></pre>