Here you can find the source of sum(Integer... ints)
public static Integer sum(Integer... ints)
//package com.java2s; //License from project: Open Source License public class Main { public static Integer sum(Integer... ints) { Integer res = null;//from w w w .j a v a2 s . c o m for (Integer i : ints) { if (null != i) { if (res == null) { res = i; } else { res = res + i; } } } return res; } }