Skip to content

Instantly share code, notes, and snippets.

@carlosmaniero
Created March 15, 2017 21:39
Show Gist options
  • Save carlosmaniero/db32f5e5415ad6e6b7d9b73f62beb61d to your computer and use it in GitHub Desktop.
Save carlosmaniero/db32f5e5415ad6e6b7d9b73f62beb61d to your computer and use it in GitHub Desktop.
import java.util.Arrays;
public class StreamSum {
public static void main(String args[]) {
int[] array = new int[]{1, 2, 3, 4, 5};
int sum = Arrays.stream(array).sum();
System.out.println(sum);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment