7.6
package sevenwork6;
public class Error {
public static void main(String[] args) {
// 输入计算的参数
Integer a = 0;
Integer b = 1;
try {
double cc = b/(double)a;
System.out.println("cc:"+cc);
} catch (NullPointerException e) {
System.out.println("空指针异常");
}catch (ArithmeticException e) {
System.out.println("计算异常");
}catch (Exception e) {
System.out.println("其他异常");
e.printStackTrace();
}
}
}