Java examples for java.lang:int Array
get int Array Sum
//package com.java2s; public class Main { public static void main(String[] argv) throws Exception { int[] num = new int[] { 34, 35, 36, 37, 37, 37, 67, 68, 69 }; System.out.println(getArraySum(num)); }//from www . ja va2 s. co m public static int getArraySum(int[] num) { int result = 0; for (int i = 0; i < num.length; i++) { result += num[i]; } return result; } }