实际上,我想要设置arraylist的指针来索引我要提供的内容,然后我的程序会检查是否还有元素,然后它会从我提供的那个索引中删除所有元素。从arraylist中删除元素
public void removefromindex(int index)
{
for (int j = notes.size(); j >notes.size(); j++)
{
notes.remove(j);
}
}
public void deleteAll(){
for (Iterator<Note> it = notes.iterator(); it.hasNext();)
{
Note note = it.next();
it.remove();
}
}
'为(INT J = notes.size(); J>时notes.size() ; j ++)'< - 再次阅读,这是没有道理的。 – Tunaki