distinct

필터링은 중간 처리 기능으로 요소를 걸러내는 역할을 한다. distinct(), filter() 메소드는 모든 스트림이 가지고 있는 공통 메소드이다. distinct() 중복을 제거하는 메소드로, Object.equals(Object o)가 true일 경우 동일 객체로 판단하여 제거한다. filter(Predicate ...) 매개값으로 주어진 Predicate가 true를 리턴하는 요소만 필터링한다. public static void main(String[] args){ List names = Arrays.asList("강성현", "강성현", "깡냉", "강냉", "깡냉"); names.stream() .distinct() // 중복 제거 .forEach(System.out::println); Syst..
깡냉쓰
'distinct' 태그의 글 목록