Notice
Recent Posts
Recent Comments
Link
목록Filtering (1)
개발자는 기록이 답이다

1. 필터링(distinct(), filter()) 필터링은 중간 처리 기능으로 요소를 걸러내는 역할을 한다. 필터링 메소드인 distinct()와 filter()메소드는 모든 스트림이 가지고 있는 공통 메소드이다. distinct()메소드는 중복을 제거하는데, Stream의 경우 Object.equals(Object)가 true이면 동일한 객체로 판단하고 중복을 제거한다. IntStream, LongStream, DoubleStream은 동일값일 경우 중복을 제거한다. package org.example.chapter16.filtering; import java.util.Arrays; import java.util.List; public class FilteringExample { public stat..
언어/Java
2023. 12. 4. 00:35