collections - Java/ Remove a Integer value from a list -
this question has answer here:
- properly removing integer list<integer> 9 answers
i have following lists of integer
whattoremove = {2, 3, 8}; and list
lst = {4, 6, 8} i want remove whattoremove elements lst.
i trying use lst.remove(whattoremove.get(i)), trying remove index, , not value.
how can that?
list<integer> whattoremove = arrays.aslist(2, 3, 8); list<integer> lst = new arraylist<integer>(arrays.aslist(4, 6, 8)); lst.removeall(whattoremove);
Comments
Post a Comment