Skip to content

Instantly share code, notes, and snippets.

@codeaholicguy
Created December 18, 2015 15:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save codeaholicguy/428a4ff03cfb00845671 to your computer and use it in GitHub Desktop.
Save codeaholicguy/428a4ff03cfb00845671 to your computer and use it in GitHub Desktop.
List<Integer> ages = new ArrayList<>();
Stream<Integer> stream = ages.stream();
Integer sum = stream.reduce(0, (age1, age2) -> age1 + age2));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment