Answers for "find sum in array java"

-1

how to find the sum of an array in java

int [] arr = {1,2,3,4};
int sum = Arrays.stream(arr).sum(); //prints 10
Posted by: Guest on October-09-2021

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language