通过看List remove方法我们就能得到答案了
public boolean remove(Object o){ if(o ==null) { for(intindex=0;index< size;index++) if(elementData[index] ==null) { fastRemove(index);returntrue; } }else{ for(intindex=0;index< size;index++) if(o.equals(elementData[index])) { fastRemove(index);returntrue; } } return false; }
原文:https://www.cnblogs.com/3-stone/p/12933236.html