Programming tutorials for the begginer
public interface Collection extends Iterable { int size(); boolean isEmpty(); boolean contains(Object o); Iterator iterator(); Object[] toArray(); T[] toArray(T[] a); boolean add(E e); boolean remove(Object o); boolean containsAll(Collection c); boolean addAll(Collection c); boolean removeAll(Collection c); default boolean removeIf(Predicate filter) { Objects.requireNonNull(filter); boolean removed = false; final Iterator each = iterator(); while (each.hasNext()) { if (filter.test(each.next())) { each.remove(); removed = true; } } return removed; } boolean retainAll(Collection c); void clear(); boolean equals(Object o); int hashCode(); default Spliterator spliterator() { return Spliterators.spliterator(this, 0); } default Stream stream() { return StreamSupport.stream(spliterator(), false); } default Stream parallelStream() { return StreamSupport.stream(spliterator(), true); } }
Collection
We will discuss more about hashCode() later
Iterable
java.lang
for(Object o : list){ //do something o; }