class AException extends Exception
{ AException(String a)
{
super(a);
}
}
class BException extends AException
{ BException(String b)
{
super(b);
}
}
class CException extends Exception
{ CException(String c)
{
super(c);
}
}
class Fu11
{
void show() throws AException
{
}
}
class Zi11 extends Fu11
{
void show() throws BException
{
}
}
class Test11
{
void function(Fu11 f)
{
try{ f.show();}
catch(AException a)
{
System.out.println(a.toString());
}
}
}
public class ExceptionDemon2 {
public static void main(String[] args)
{
Test11 t=new Test11();
t.function(new Fu11());
t.function(new Zi11());
}
}
大家帮我看看这个为什么没有结果,我觉得应该结果应该输出为AException和BException才对啊 |
|