Java中ArrayList去除重复元素
//删除ArrayList中重复元素
public static void removeDuplicate(ArrayList<ForCytoLevel3> list) {
for ( int i = 0 ; i < list.size() - 1 ; i ++ ) {
for ( int j = list.size() - 1 ; j > i; j -- ) {
ForCytoLevel3 jjj =(ForCytoLevel3)list.get(j);
ForCytoLevel3 iii =(ForCytoLevel3)list.get(i);
if ( iii.getData().getId().equals(jjj.getData().getId() )) {
list.remove(j);
}
}
}
System.out.println(list);
}