Looked at another thread but unforuntly wasnt abble to fix the problem. With the current code i get the error with [if (punktlista[antalValdaHorn].getNamn() == punktlista[i]