The method iterator () is declared in java.util.Collection and in java.lang.Iterable, its superinterface?

Can someone explain to me why the Iterator<E> iterator(); method Iterator<E> iterator(); defined in java.util.Collection ? The collection is already expanding java.lang.Iterable ; this method is redundant. Is it for convenience?

+7
java collections
source share

All Articles