您的位置:首页 > 其它

ArcGIS Web 地图制作指南

2015-10-16 13:07 260 查看
如下面的代码,结果就不解释了。

 

public class TryTest
{
public static void main(String[] args)
{
TryTest tt = new TryTest();

tt.test1();

System.out.println();

tt.test2();

System.out.println();

tt.test3();
}

public void test1()
{
int a = 2;

System.out.println("start");

try
{
a = a/0;

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

}finally
{
System.out.println("finally");
}

System.out.println("end");
}

public void test2()
{
int a = 2;

System.out.println("start");

try
{
a = a/0;

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

return;

}finally
{
System.out.println("finally");
}

System.out.println("end");
}

public void test3()
{
int a = 2;

System.out.println("start");

try
{
a = a/0;

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

System.exit(0);

}finally
{
System.out.println("finally");
}

System.out.println("end");
}

public void test()
{
//只有final可以使用
final int a = 1;
//		static int b = 2;
//		final static int c = 3;
//		private int d = 4;
}
}

 

 

输出为:

 

start
catch
finally
end

start
catch
finally

start
catch

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