The code -
for(int i = 0; i < count; i++)
{
System.out.println("Please enter a number!");
try{
numbers[i] = keyboardScanner.nextInt();
}catch(InputMismatchException ex)
{
System.out.println("You did not enter a number!");
}
}
If you enter a String, it loops till 'count'. Why does that happen ?