I have a class Objekt in java in that class I wrote a function to check objects the serial number of objects from other classes and I keep getting .equals error. I was wondering is it because I wrote String function and the serial number(Evidenca) is int or I wrote something wrong. So any ideas are welcome.
boolean obstaja = false;
for(PoslovniProstor pp : this.PoslovniProstori)
{
if(pp.getEvidenca().equals(poslovniProstor.getEvidenca()))
{
obstaja = true;
break;
}
}
This colors .equals in red bare in mind that the class I am taking an object from is PoslovniProstor and I created an ArrayList in this class Objekt and is called PoslovniProstori
public ArrayList<PoslovniProstor> getPoslovniProstori(){
return this.PoslovniProstori;
}
So yea any help is welcome. :D