Попробуйте вместо этого.По сути, вам не нужно увеличивать индекс, пока у вас нет правильного ввода.
int i = 0;
while( i < 5 ) {
System.out.println("Enter the 5-digit ID number of your customer "
+ (i + 1) + "'s below:");
customerID[i] = myScanner.nextLine();
if (customerID[i].length() != 5) {
/* Print an error and do not increment.
* The next line will overwrite the current one. */
} else {
/* Increment and move on */
i++;
}
}