Last active
March 3, 2018 02:51
-
-
Save LeoHeo/a6132c574cddd85038b8d48cfda07dc3 to your computer and use it in GitHub Desktop.
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
class StreamExamples { | |
public static void main(String[] args) { | |
final List<Integer> numbers = Arrays.asList(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); | |
numbers.stream() | |
.filter(number -> number > 3) // Intermediate Operation Method -> 즉시 연산을 안하고 기다린다. | |
.map(number -> number * 2) // Intermedidate Operation Method -> 즉시 연산을 안하고 기다린다. | |
.filter(number -> number > 10) // Intermedate Operation Method -> 즉시 연산을 안하고 기다린다. | |
.findFirst() // Terminal Operaion Method -> filter, map연산들을 한다. | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment