try catch fianlly 笔试题
来源:互联网 发布:怎么比对两列数据 编辑:程序博客网 时间:2024/05/29 12:00
前几天刚转了一个try catch finally return的博客,今天就遇到了这种笔试题,那篇博客看明白了,就可以很轻松的做出来了。
http://blog.csdn.net/zhaoyayua/article/details/38614513
现在将题打出来,共同学习下。
class TryCatchDemo {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);foo(1);System.out.println(output);}}
运行结果为
13423
0 0
- try catch fianlly 笔试题
- try-catch-fianlly
- try catch finally一道笔试题
- try catch
- try{} catch{}
- try catch
- try...catch
- try{} catch(...){}
- try catch
- try-catch
- try catch
- try-catch
- try catch
- try catch
- try catch
- try catch
- try catch
- try {...} catch (){....}
- list contains() 与containsAll()
- 二叉树的定义
- HDU 1027 Ignatius and the Princess II (STL全排列)
- 面向对象oop
- SQL Server DBA 必须了解的性能调优要点
- try catch fianlly 笔试题
- hdu 4970 Killing Monsters 多校第九场
- MongoVUE1.5完全破解版赠送
- 上传文件到服务器
- MFC中char*,string和CString之间的转换
- 文本和图形的切换
- 高举Domain Specification,应用函数式编程
- unity3d蒙灰效果
- c#中的string.split()方法