Finding duplicate values in arraylist

后端 未结 5 711
你的背包
你的背包 2020-11-28 06:41

I have an ArrayList

For Example

class Car{
   String carName;
   int carType;
}

Now, I have to find if the

5条回答
  •  半阙折子戏
    2020-11-28 07:23

    Override equals() and hashCode() methods in your Car class and use a Set implementation such as HashSet instead of ArrayList.

提交回复
热议问题