java 处理异常练习题

package Hanqi.ec;
import java.util.Scanner;
public class zuoyekehushuru {
    public static void main(String[] args) {
        
        
    System.out.println("请输入一个数字:");
    try{
    Scanner b=new Scanner(System.in);
    int a =b.nextInt();
    }
    catch(Exception ee)
    {
        System.out.println("请您输入正确的数字");
    }
        
}
}

 

posted @ 2016-05-27 21:56  薛岩  阅读(370)  评论(0编辑  收藏  举报