package a; import java.util.*; public class YiChang { public static void main(String[] args) { System.out.println("输入整数:"); try { Scanner a=new Scanner(System.in); int b=a.nextInt(); } catch (Exception e) { e.printStackTrace(); System.out.println("输入有误!"+e.getMessage()); } } }