Created
October 14, 2014 09:39
-
-
Save RichardWarburton/3274e6e1bbd18a1cb79d to your computer and use it in GitHub Desktop.
Python Example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Python: | |
# Even numbers between 1 and 49: | |
[ x for x in range(1,50) if x % 2 == 0 ] | |
Java: | |
// Even numbers between 1 and 49: | |
IntStream.range(1, 50).filter(x -> x % 2 == 0).boxed().collect(toList()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Comprehension with java 8 and groovy-streams ;-)