Why does my program return the error "ArrayIndex Out Of Bounds Exception: 4"?

I just explained it:

a 2nd for loop within the for loop

// using i2 here within the for loop with i
for (int i2=0; i2<genpart.length;  i2++) {
  print(genpart[i2] + " "); 
}
1 Like