I’m reviewing for a class, and this is an old question:
I need to write a method
void addAll(Collection c1, Collection c2);
that adds all the elements in c2 to c1.
Could I just do something with addAll? I’m not familiar with it, but it seems like I could write:
c1.addAll(c2);
Yes, that’ll work. The boolean returned determines whether the collection has been modified by the call.
http://download.oracle.com/javase/6/docs/api/java/util/Collection.html#addAll(java.util.Collection)