sum static method

int sum(
  1. List<int> array
)

@param array values to sum @return sum of values in array

Implementation

static int sum(List<int> array) {
  int count = 0;
  for (int a in array) {
    count += a;
  }
  return count;
}