I wonder why the Collection.addAll()
method only accepts other Collection
s but not Iterable
s. Why is that?
Any similar method to do that for Iterable
s?
Presumably because the Collection
interface was introduced in Java 1.2 whereas Iterable
appeared only in 1.5, and changing the interface would break all existing implementations.