I'm currently writing a for loop to go through a 2D with 38 elements. However, some of those elements are null and I want the for loop to simply skip over them (because in the puzzle I'm solving they have no moves associated with them). A quick search revealed that I can skip an iteration with a simple continue statement in an if statement at the begiing of the for loop. However, I want to skip multiple iterations, and the if statement I wrote isn't working:
for (int i = 0; i < triplets.length; i++) {
if (i == 18 || 19 || 25 || 26 || 28 || 29 || 31 || 32) {
continue;
}
Is there an alteative to making 8 individual if statements or am I stuck with that?