Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

how to find the sum of an array in java

int [] arr = {1,2,3,4};
int sum = Arrays.stream(arr).sum(); //prints 10
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #find #sum #array #java
ADD COMMENT
Topic
Name
8+1 =