Remove elements from arraylist based on a condition [closed]
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 years ago . I have an ArrayList whose each element is of type DataType, where DataType is a class: class DataType{ String dId; String dType; String rId; } I need to remove all such elements from the list whose rId is equal to any other element's dID. i.e. if DataType D1 has value of dID as "abc" and DataType D2 has value of