Skip to content

Instantly share code, notes, and snippets.

@hertzsprung
Created June 21, 2012 20:11
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 hertzsprung/2968247 to your computer and use it in GitHub Desktop.
Save hertzsprung/2968247 to your computer and use it in GitHub Desktop.
Internal iteration with forEach()
List<String> names = Arrays.asList("Alice", "Bob", "Charlie", "Dave");
names
.filter(e -> e.length() >= 4)
.forEach(e -> { System.out.println(e); });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment