I have this 3 classes(above).
My application runs without errors but it doesn't work correctly.
For example if i have for one DotCom Object this coords:
coord 1 = b3 coord 2 = b4 coord 3 = b5
when i enter b3 it says Ratat(Miss), but for b4 and b5 it says Lovit(Hit) so i can't destroy any DotCom object.
It's the same for all 3 Objects.
I can't figure out where it is the problem, i rechecked the program 2 times with the book but everything seems ok.
Can anyone please tell me what i'm doing wrong ?
I have checked that indexOf method, and as i understood it says that it returns the index of the first match of the specified element in the list.
But i still can't understand why the first one is never found and the next two are found correctly.