您的位置:首页 > 编程语言 > Java开发

struts2标签详解

2015-10-21 14:56 513 查看
代码如下:

 

public class Test1
{
public static void main(String[] args)
{
C c = new C();

try
{
c.getExcC();

}catch(Exception e)
{
System.out.println(e.getClass().getName());
}
}
}

class Aexception extends Exception
{

}

class Bexception extends Exception
{

}

class C
{
public void getExcA() throws Aexception
{
throw new Aexception();
}

public void getExcB() throws Bexception
{
throw new Bexception();
}

public void getExcC() throws Exception
{
try
{
getExcA();

}finally
{
getExcB();
}
}
}

 

 

输出为:

 

Bexception

 
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: