|
Two Methods to Remove Duplicates in an ArrayList Here are two methods that allow you to remove duplicates in an ArrayList. removeDuplicate does not maintain the order where as removeDuplicateWithOrder maintains the order with some performance overhead. 1.The removeDuplicate Method: 2.The removeDuplicateWithOrder Method:
/** List order maintained **/ public static void removeDuplicateWithOrder(ArrayList arlList) |
|
|
來(lái)自: 小朋 > 《核心Java技術(shù)》