Deleting objects from an ArrayList in Java

前端 未结 13 1968
轮回少年
轮回少年 2020-12-15 03:14

I need to delete some objects from an ArrayList if they meet a condition and I\'m wondering which way could be more efficient.

Here\'s the situation: I

13条回答
  •  一生所求
    2020-12-15 04:03

    Maybe Iterator’s remove() method? The JDK’s default collection classes should all creator iterators that support this method.

提交回复
热议问题