Finding duplicate values in arraylist
I have an ArrayList<Car>
For Example
class Car{
String carName;
int carType;
}
Now, I have to find if the list has any cars having same name. What is the best way to do this?
I have an ArrayList<Car>
For Example
class Car{
String carName;
int carType;
}
Now, I have to find if the list has any cars having same name. What is the best way to do this?