posted 13 years ago
Hi,
I've an ArrayList of Obejcts, and I would like to remove a subset of Objects at once. The problem is that, when I iterate over an Arraylist, and I remove an Object, the other objects are reallocated, and son it's impossible to remove a subset of objects at once. Each Object contains a id.
Here's an example:
I've a list with Objects:
List {Obj1, Obj2, Obj3, Obj4, Obj5}.
And now I would like to remove Obj2 and Obj5 at once.
Probably the ArrayList is not the best Collection to do that, but what other collection should I use?