Here you can find the source of sum(int[] arr)
private static int sum(int[] arr)
//package com.java2s; //License from project: Apache License public class Main { private static int sum(int[] arr) { int num = 0; for (int i = 0; i < arr.length; i++) { num += arr[i];/*w w w . j av a 2s .c o m*/ } return num; } }