STREAM
-
[JAVA] Stream이란?Language/자바 2020. 2. 18. 14:27
자바에서 유용하게 쓰이는 Stream. Stream이 어떻게 유용할까? Stream은 영 단어 그대로 해석보면 개울, 시내, 줄기 등의 뜻을 가지고 있다. Buffer로 부터 입력을 받을 때, 출력을 할 때 역시 이 Stream을 사용한다. 가장 중요한 것은 바로 Stream의 역할은 데이터를 필터, 수집, 집계, 그룹화 해주는 것이다. 예를들어 다음과 같은 Human class가 정의되어 있다고 하자. class Human{ public static int MALE = 0; public static int FEMALE = 1; String name; int age; int sex; public Human(String name, int age, int sex){ this.name =..