Removing Duplicate Values from ArrayList

后端 未结 18 1273
无人及你
无人及你 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:48

    In case you just need to remove the duplicates using only ArrayList, no other Collection classes, then:-

    //list is the original arraylist containing the duplicates as well
    List uniqueList = new ArrayList();
        for(int i=0;i

    Hope this helps!

提交回复
热议问题