设为首页收藏本站

期待广告

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
热搜: 活动 交友 discuz
查看: 1152|回复: 0
打印 上一主题 下一主题

异常处理36计

[复制链接]
跳转到指定楼层
1#
发表于 2008-1-8 18:20 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
1:上屋抽梯 即然异常发生了,何不把异常带来的错误给掩掉,让异常上得了屋,下不了地

2:笑里藏刀 发生了异常,你依然可以对着你的项目经理哈哈大笑,当作不知情。

3:假痴不癫 异常?发生异常是正常的。。。

4:金蝉脱壳 嗯。。。这个异常不是我导致的。

5:反客为主 异常?你异常吧?这能算异常,这都异常天底下没有正常的了

6:空城计 try{|catch(Exception e){ System.out.println("i can`t see anything")}

7 反间计 try{}catch(Exception e){ e = null;}

8 釜底抽薪 将异常代码delete,面对产生的更多异常甚至无法启动对项目经理严肃斥责:“你的观察能力有问题”

9 掩耳盗铃 try{}catch(Exception e){ System.out.println("all right all right move move")}

10 抛砖引玉 try{}catch(Exception e){throw new java.lang.OutOfMemoryError("")}

11 走为上策 try{}catch(Exception e){
String content = FileManager.getFileContent("离职申请.doc");
throw new Exception(content);
}

12 美人计 try{}catch(Exception e){if e.getMessage.equle("plmm") ;else throw e;}

13 欲擒故纵
try{}catch(Exception e){
StaticN++;
e.printStackTrace();
throw new Exception(e);
if (StaticN==10000){
System.out.println("一个程序10000个异常,JVM坏了吧?");
}
}


14 连环计
try{

}catch(Exception e){
try{
throw new Exception();
}catch(Exception ee){
try{
throw new Exception();
}catch(Exception eee){
try{
throw new Exception();
}catch(Exception eeee){
try{
throw new Exception();
}catch(Exception eeeee){
...
}
}
}
}
}


15 远交进攻
try{}catch(Exception e){
System.out.println("人间蒸发掉"+e);
Runtime.getRuntime().exec("rm errot.log");
}

16 苦肉计
try{}catch(Exception e){
System.out.println("我上有八十岁老母,下有要喂奶的孩子,项目经理你不能这么忍心炒我吧?");
}

17 借刀杀人 try{}catch(Exception e){System.out.println("我叫刘星不要这样写,他就说一定要这样写")};

18 顺手牵羊
try{}catch(Exception e)
{
try{
HuionErrorFuction();
}catch(HuionException he){
e.printStackTrace();
he.printStackTrace();
System.out.println("一起异常,异常娱乐专家");
}
}

19 调虎离山
try{
huionErrorFunction();
}catch(Exception e){
liuxingNormalFunction();
}


20 关门捉贼
try{
}catch(Exception e){
Thread.sleep(10000000000000000000);
}
}


21 隔岸观火
try{
}catch(Exception e){
Runtime.getRuntime().exec("C:/熊猫烧香.exe");
}
}

22 无中生有
try{
System.out.println("项目经理好久没来看我了");
System.out.println(new Exception(e));
}catch(Exception e){
}
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 分享分享
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|骏景花园业主论坛 ( 粤ICP备2021144690号-2  

GMT+8, 2025-8-15 23:04 , Processed in 0.120559 second(s), 20 queries .

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表