编码 -
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!");
}
}
如果你输入一个字符串,它会循环直到'count'。为什么会这样?