I have an issue.
I have an array that holds car objects (make, year, colour....etc)
I have overridden equals to test if a car colour is equal to another car colour.
Now I want to test if they are the same model. How can I use equals for this when I have already used it for the colour. Both variables colour and model are Strings.
Car1, Ford, Blue, 2001
Car2, BMW, Red, 2002
Car3, Ford, Red, 2004.
public boolean equals(Object obj)
Car a = (Car) obj;
Thanks in advance.