public static void main(String[] args) {
System.out.println(newTest().test());
}
staticint test()
{
int x = 1;
try
{
return x;
}
finally
{
++x;
}
}
}
---------执行结果 ---------
1
public class smallT{
public static void main(String args[]){
smallT t = new smallT();
int b = t.get();
System.out.println(b);
}
public int get()
{
try {return 1;}
finally{return 2;}
}}
---------执行结果 ---------
2