Android Array Sum getArraySum(int... i)

Here you can find the source of getArraySum(int... i)

Description

get Array Sum

Declaration

public static int getArraySum(int... i) 

Method Source Code

//package com.java2s;

public class Main {

    public static int getArraySum(int... i) {
        int sum = 0;
        for (int j = 0; j < i.length; j++) {
            sum += i[j];//from www .  j  a  va 2 s  .c o m
        }
        return sum;
    }
}