Removing Duplicate Values from ArrayList

后端 未结 18 1295
无人及你
无人及你 2020-11-30 03:24

I have one Arraylist of String and I have added Some Duplicate Value in that. and i just wanna remove that Duplicate value So how to remove it.

Here Example I got o

18条回答
  •  一向
    一向 (楼主)
    2020-11-30 03:57

    public static List removeDuplicateElements(List array){
        List temp = new ArrayList();
        List count = new ArrayList();
        for (int i=0; i0;i--) {
                array.remove(i);
            }
            return array;
        }
    }
    

提交回复
热议问题