I have the following code so far:
/*
* This method adds only the items that don’t already exist in the
* ArrayCollection. If items were added return true, otherwise return false.
*/
public boolean addAll(Collection<? extends E> toBeAdded) {
// Create a flag to see if any items were added
boolean stuffAdded = false;
// Use a for-each loop to go through all of the items in toBeAdded
for (something : c) {
// If c is already in the ArrayCollection, continue
if (this.contains(c)) { continue; }
// If c isn’t already in the ArrayCollection, add it
this.add(c)
stuffAdded = true;
}
return stuffAdded;
}
}
My question is: what do I replace something (and c) with to make this work?
addAllhere :-)