DESKTOP-6MK5BDT_20200907-姚玉龙
1、问题
感觉应该能移除相同的元素呀,好像貌似没有移除
@Override
public boolean retainAll(Collection<?> c) {
if(c instanceof Bag) {
Bag other = (Bag)c;
Object[] otherElements = other.elements;
for(int i=0;i<other.counter;i++) {
if((contains(otherElements[i]))==true) {
this.remove( i );
}
}
}
return false;
}
2、吐槽
秋天都过去好长时间了,还这么热
点赞