filter metodu
İmzası şöyle.
Şöyle yaparız.
İmzası şöyle.
Collection<E> filter(Collection<E> collection, Predicate<? super E> predicate);
Açıklaması şöyle. Iterators.filter() metoduna benzer. Girdi olarak Collection alır, çıktı olarak Collection döner.A few things to note here – first, the output of Collections.filter() is a live view of the original collection – changes to one will be reflected in the other.Örnek
It’s also important to understand that now, the result is constrained by the predicate – if we add an element that doesn’t satisfy that Predicate, an IllegalArgumentException will be thrown:
Şöyle yaparız.
Collection2.filter(collection, () -> ...)
Hiç yorum yok:
Yorum Gönder