如题所述
try {
int b = Integer.parseInt(str);
} catch (Exception e) {
System.out.println("这不是数字");
continue; //可以在这里写不是数字后的逻辑
}