I'm using ArrayList. But the problem is that the indexOf function is not working in a for loop. It's showing 0 for all the elements or objects.
Code goes like that for a FOR loop :
for(or_data or : counts.or_gates)
{
if (or.isHit(x, y))
{
mutual=counts.or_gates.indexOf(or);
set_move_cursor();
or.addX(dx);
or.addY(dy);
System.out.println("Got the Hit"+mutual);
repaint();
break;
}
}
or_data is a ArrayList but mutual comes out to be 0 all the time. Any suggestion on that?