锘??xml version="1.0" encoding="utf-8" standalone="yes"?>av成人男女,日av在线播放,你懂的亚洲视频http://www.aygfsteel.com/xun56789/archive/2008/08/19/223117.htmlxunSir.leexunSir.leeTue, 19 Aug 2008 14:19:00 GMThttp://www.aygfsteel.com/xun56789/archive/2008/08/19/223117.htmlhttp://www.aygfsteel.com/xun56789/comments/223117.htmlhttp://www.aygfsteel.com/xun56789/archive/2008/08/19/223117.html#Feedback0http://www.aygfsteel.com/xun56789/comments/commentRss/223117.htmlhttp://www.aygfsteel.com/xun56789/services/trackbacks/223117.html 濡傛灉涓嶆槸寰堟湁蹇呰錛屽氨Exception灝監K浜?br />
 1public class Demo {
 2    public static void main(String args[]) {
 3        int i = 0;
 4        try {
 5            if (i == 0{
 6                throw new LeafException();
 7            }

 8        }
 catch (TreeException e) {
 9            e.printStackTrace();
10        }

11    }

12}

13
14class TreeException extends Exception{
15    public TreeException () {
16        System.out.println("TreeException()");
17    }

18}

19
20class LeafException extends TreeException{
21    public LeafException () {
22        System.out.println("LeafException()");
23    }

24}

鎵撳嵃緇撴灉錛?br /> TreeException()
LeafException()
LeafException
        at Demo.main(Demo.java:6)

xunSir.lee 2008-08-19 22:19 鍙戣〃璇勮
]]>
綾葷殑緇ф壙http://www.aygfsteel.com/xun56789/archive/2008/08/18/222885.htmlxunSir.leexunSir.leeMon, 18 Aug 2008 14:13:00 GMThttp://www.aygfsteel.com/xun56789/archive/2008/08/18/222885.htmlhttp://www.aygfsteel.com/xun56789/comments/222885.htmlhttp://www.aygfsteel.com/xun56789/archive/2008/08/18/222885.html#Feedback2http://www.aygfsteel.com/xun56789/comments/commentRss/222885.htmlhttp://www.aygfsteel.com/xun56789/services/trackbacks/222885.html     1錛氬瓙綾繪柟娉曚紭鍏堟绱㈠茍浣跨敤瀛愮被鐨勬柟娉?br />     2錛氬瓙綾諱笌鐖剁被鐨勫睘鎬ч兘鏄瓨鍦紝寮曠敤綾誨瀷鏄埗綾繪椂灝變嬌鐢ㄧ埗綾誨睘鎬э紝鏄瓙綾誨氨浣跨敤瀛愮被灞炴?br />     3
錛氳皟鐢ㄧ埗綾繪柟娉?super.method())錛岀埗綾繪柟娉曚腑錛?br />         璋冪敤鏂規硶錛屼紭鍏堟悳绱㈠瓙綾諱腑鏄惁鏈夎鏂規硶錛岀劧鍚庢槸鐖剁被鐨勶紱
        璋冪敤灞炴э紝鍒欐槸浣跨敤鐖剁被鐨勫睘鎬с?br />
 1class Tree {
 2    int i = 3, j = 5;
 3
 4    public Tree() {
 5        this.show("Tree");
 6    }

 7
 8    protected void show(String s) {
 9        System.out.println(s);
10    }

11
12    public void t() {
13        this.show("Tree, t");
14        System.out.println(this.i);
15        System.out.println(this.j);
16    }

17}

18
19class Leaf extends Tree {
20    int i = 10;
21
22    public Leaf () {
23        this.show("Leaf");
24    }

25
26    public void show(String s) {
27        System.out.println(s + "\t\tLeaf");
28    }

29
30    public void t() {
31        show("Leaf, t");
32        System.out.println(this.i);
33        System.out.println(this.j);
34        System.out.println();
35        super.t();
36    }

37
38    public static void main(String args[]) {
39        Leaf l = new Leaf();
40        l.t();
41
42        System.out.println("------------------");
43        System.out.println(l.i);
44        Tree t = new Leaf();
45        l = (Leaf) t;
46        System.out.println(t.i);
47        System.out.println(l.i);
48    }

49}

50


鎵撳嵃緇撴灉錛?br />

 

Tree            Leaf
Leaf            Leaf
Leaf, t         Leaf
10
5

Tree, t         Leaf
3
5
------------------
10
Tree            Leaf
Leaf            Leaf
3
10



xunSir.lee 2008-08-18 22:13 鍙戣〃璇勮
]]>
主站蜘蛛池模板: 镇平县| 通山县| 神池县| 积石山| 宝坻区| 同江市| 武强县| 屏山县| 昌宁县| 广元市| 南和县| 桐城市| 华蓥市| 尼玛县| 宣武区| 洱源县| 南开区| 克什克腾旗| 乃东县| 平定县| 怀来县| 嘉义县| 乐东| 澄江县| 徐闻县| 广州市| 新野县| 伊春市| 康马县| 凤凰县| 青岛市| 二连浩特市| 勃利县| 广汉市| 平潭县| 镇坪县| 辉南县| 平南县| 乐都县| 黎城县| 通辽市|