title: looping to find sum of array java
body: <p>I am making program that adds up the values from an array of a class. I keep getting an error about binary operators. My code is:</p>
  
  <pre><code>public static int sum(Array[] x){
     int sum = 0;
     for (int i = 0; i &lt; x.length; i++){
         sum += x[i];
     }
     return sum;
  }
  </code></pre>
  
  <p>Thanks in advance!</p>