public class Step28 {

    public static void main (String args[]) {
        
        Integer[] a = {new Integer(1),
                       new Integer(2),
                       new Integer(3),
                       new Integer(4)};

        System.out.println("Sum = " + addInts(a));
    }

    public static int addInts(Object[] x) {
        int sum=0;
        for (int i=0; i<x.length; i++) {
            sum += (Integer) x[i];
        }
        return sum;
    }
}
