标签:int public throws student string main else sys normal
public class Test{
public static void main(String args[ ]) throws Exception{
try {
Student.a=new Student();
a.s(2);
}catch(肚子疼 e1){
System.out.println(e1);
}catch(呕吐 e2){
System.out.println(e2);
}catch(不会做 e3){
System.out.println(e3);
catch(睡着了 e4){
System.out.println(e4);
}
}
}
public class Student{
public void s(int i) throws Exception{
if(i == 0){
System.out.println("normal");
}
else if(i == 1){
throw new 肚子疼();
}
else if(i == 2){
throw new 呕吐();
}
else if(i == 3){
throw new 不会做();
}
else if(i == 4){
throw new 睡着了();
}
}
}
标签:int public throws student string main else sys normal
原文地址:https://www.cnblogs.com/l2760186162/p/10786291.html