我已经有以下代码:
我的问题是:我需要用什么替换 something 和 c 才能使这个代码工作?
我已经有以下代码:
/*
* 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;
}
}
我的问题是:我需要用什么替换 something 和 c 才能使这个代码工作?
addAll
:-) - aioobe