java reduce1 Java - Stream 최종 연산자(reduce) reduce - 스트림의 요소를 하나씩 줄여가며 누적연산 수행 함수 인터페이스 Optional reduce(BinaryOperator accumulator) T reduce(T identity, BinaryOperator accumulator) U reduce(U identity, BiFunction accumulator, BinaryOperator combiner) 매개변수 identity - 초기값 accumulator - 이전 연산결과와 스트림의 요소에 수행할 연산 combiner - 병렬처리된 결과를 합치는데 사용할 연산(병렬 스트림) // OptionalInt reduce(IntBinaryOperator accumulator)// 연산된 결과값과 다음 값을 계속 비교한다. OptionalInt .. 2017. 3. 9. 이전 1 다음