array sum in java