为什么我在输入非数字令牌时会出现无限循环?
public class ExceptionHandling {
static int i;
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
boolean b=true;
Scanner in=new Scanner(System.in);
while (b ==true) {
try{
i=in.nextInt();
b=false;
// System.out.println("not executrd bcoz above exception");
}
catch(InputMismatchException e){
System.out.println(i);
}
}
}
}