Just for fun:
for(int d = 0; d < amountOfNeighbors; d++){
for(int c = 0; c < myArray.size(); c++){
...
d = amountOfNeighbors;
break;
...
}
// No code here
}
Comment on break label : it's a forward goto. It can break any statement and jump to the next:
foo: // Label the next statement (the block)
{
code ...
break foo; // goto [1]
code ...
}
//[1]