public static void main(String[] args) {
int[] x = new int[3];
Scanner inputScan = new Scanner(System.in);
for(int i = 0; i < x.length; i++){
System.out.println("Please input the "+i+" integer:");
String inputInt = inputScan.nextLine();
try {
x[i] = Integer.parseInt(inputInt);
} catch (NumberFormatException e) {
System.out.println("您输入的数字格式有误,请重新输入");
i--;
}
}
System.out.println(Arrays.toString(x));
}
这个算对异常机制的滥用吗?