本帖最后由 余松霖 于 2011-12-16 11:04 编辑
- {
- public static String output="";
- public static void foo(int i)
- {
- try
- {
- if(i==1)
- throw new Exception();
- output+="1";
- }
- catch(Exception e)
- {
- output+="2";
- return;
- }
- finally
- {
- output+="3";
- }
- output+="4";
- }
- public static void main(String args[])
- {
- foo(0);
- System.out.println(output);//134
- foo(1);
- System.out.println(output); //13423
- }
- }
-
复制代码 如题 output+="1" 这样的算法有点昏!! 求解释下!! |