Good morning, I need to check if an object's color is the same of another's color. I tried the most classical way to do it. Here is how:
boolean Color checkColor()
{
if(obj1.getColor()==obj2.getColor)
return true;
else
return false;
}
In another method I did this to check if it functions:
public String ToString()
{
if(checkColor()==true)
return "OK";
else
return "NO";
}
this way does not work. How can I check if two colors are the same? is there another way to do it? Or this method is correct but I wrong something else? Thank you very much