SE450
:
AbstractCollection Class
[17/63]
Collection
is a hefty interface
Convenient for clients, inconvenientfor implementors
Many methods can be implemented from others (Template method!)
Example:
toArray
public E[] toArray()
{
E[] result = new E[size()];
Iterator e = iterator();
for (int i = 0; e.hasNext(); i++)
result[i] = e.next();
return result;
}