红桃J

用心写好每行完美的代码,远比写一堆更有价值

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::
 1 import java.util.*;
 2 
 3 public class MyException extends Exception {
 4 
 5     private static final Exception Exception = null;
 6     private static final Exception NullPointerException = null;
 7 
 8     public static void main(String[] args) {
 9         try {
10             throw (NullPointerException);
11         } catch (NullPointerException e) {
12             System.out.println("@@@@@");
13         } catch (Exception e) {
14             System.out.println("$$$$");
15         } finally{
16             System.out.println("#####");
17         }
18     }
19 
20 }

 

结果:

@@@@@
#####

posted on 2015-06-07 00:05  红桃J  阅读(196)  评论(0编辑  收藏  举报