Örnek
Şöyle yaparız
List<Integer> integers = Arrays.asList(1,2,3,4,5,6,6);List<String> strings = Arrays.asList("alpha","beta","gamma");integers.stream().collect(Collectors.minBy(Comparator.naturalOrder())).get();// output: 1strings.stream().collect(Collectors.minBy(Comparator.naturalOrder())).get();// output: alpha
Hiç yorum yok:
Yorum Gönder