您的位置:首页 > 其它

基础卷_异常篇 第12集 异常练习

2016-04-29 23:01 281 查看
小练习一枚:写出程序结果

public class lianxi_1 {

public static void function() throws Exception
{
try
{
throw new Exception();
}
finally
{
System.out.println("B");
}
}

public static void main(String[] args)
{
try
{
function();
System.out.println("A");
}
catch (Exception e)
{
System.out.println("C");
}
System.out.println("D");
}

}


运行结果:

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