为什么下边的程序总是提示非法语句开始了?请大家帮忙看看
class Demo
{
public static void func()
{
try
{
show();
System.out.println("A");
}
catch(Exception e)
{
System.out.println("B");
}
}
public static void main(String[] args)
{
try
{
func();
}
catch(Exception e)
{
System.out.println("C");
}
public static void show()throws Exception//将异常封装到方法中
{
throw new Exception();
}
System.out.println("D");
}
}
|
|