ÖrnekThe name toList is not intention revealing by itself. Naming the method toUnmodifiableList would have made it consistent with the same method on Collectors.
Şöyle yaparız
List<Integer> evenNos = nos.stream().filter(i -> i % 2 == 0).toList();//.collect(Collectors.toList())System.out.println("Even numbers : "+evenNos);
Hiç yorum yok:
Yorum Gönder