关于异常的问题
java编程思想第3版 第九章习题6编译通不过....谁能告诉我是什么问题......谢谢
class myException1 extends Exception
{}
class myException2 extends Exception
{}
class T
{
void g() throws myException1
{
throw new myException1();
}
public void f()
{
try{g();}
catch(myException1 e){throw new RuntimeException(e);}
}
}
public class Test
{
public static void main(String[] arg)
{
T t=new T();
try{
t.f();
if(false){throw new myException2();}
}
catch(RuntimeException re)
{
try{throw re.getCause();}
catch(myException1 e){System.out.println(e);}
}
catch(myException2 e){}
}
}