Back
I'm having a problem finding the sum of all of the integers in an array in Java.
To find the sum of all the numbers in an array in java.
int[] a = {100,200,300,400,500};
int SUM = IntStream.of(a).sum();
System.out.println("The sum is " + sum);
Output:
The sum is 1500.
31k questions
32.8k answers
501 comments
693 users