好记性不如烂笔头,。。。
public static List<Object> remTwice(List<Object> ol) {
for (int a = 0; a < ol.size();) {
int i = 0;
List<Object> ot = new ArrayList<Object>();
for (int b = 0; b < ol.size(); b++) {
if (ol.get(a).equals(ol.get(b))) {
i++;
if (i > 1) {
ot.add(ol.get(b));
}
}
}
if (ot.size() != 0) {
remTwice(ol, ot);
} else {
a++;
}
}
return ol;
}
public static List<Object> remTwice(List<Object> ol, List<Object> ot) {
for (Object o : ot) {
ol.remove(o);
}
return ol;
}