Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
似乎 usingi -= i.head不会执行与i.remove(0) ListBuffer 相同的功能。那正确吗。如果是,为什么?
i -= i.head
i.remove(0)
i -= i.head返回修改后的ListBuffer.
ListBuffer
i.remove(0)返回从 中删除的元素ListBuffer。
在任何一种情况下,得到的修改ListBuffer都是相同的。