将 try / catch 放入 while循环中 :
while (option != 0) { final Scanner keyb = new Scanner(System.in); System.out.println(""); try { switch (option) { } } catch (Exception InputMismachException) { System.out.println("nPlease Enter a Valid Numbern"); option = menuSystem(); } }
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)