public class ExceptionTest {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
Etest a = new Etest();
try {
System.out.println("begin");
a.test();
System.out.println("end");
}catch(Exception e) {
System.out.println("Exception");
}
}
}
class Etest {
public void test() throws Exception {
throw new IllegalAccessException();
}
}
运行结果:
begin
Exception