锘??xml version="1.0" encoding="utf-8" standalone="yes"?>天堂va蜜桃一区二区三区,国产一区免费在线观看,青青久草在线http://www.aygfsteel.com/xun56789/category/33864.html鏃墮棿闀夸簡錛屾墜鎸囦細(xì)鐥?/description>zh-cnSat, 04 Oct 2008 15:33:52 GMTSat, 04 Oct 2008 15:33:52 GMT60綾葷殑緇ф壙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 />         璋冪敤鏂規(guī)硶錛屼紭鍏堟悳绱㈠瓙綾諱腑鏄惁鏈夎鏂規(guī)硶錛岀劧鍚庢槸鐖剁被鐨勶紱
        璋冪敤灞炴э紝鍒欐槸浣跨敤鐖剁被鐨勫睘鎬с?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



]]>
主站蜘蛛池模板: 绥棱县| 周口市| 鸡东县| 建水县| 昌宁县| 衡东县| 宜兴市| 东明县| 宁夏| 临武县| 廉江市| 吉隆县| 宝坻区| 万载县| 固始县| 淮滨县| 大悟县| 莒南县| 武义县| 永修县| 太仆寺旗| 当阳市| 龙川县| 临邑县| 南皮县| 巴彦淖尔市| 达孜县| 济阳县| 贵南县| 微山县| 徐州市| 景泰县| 彭州市| 集安市| 嘉禾县| 清镇市| 秦皇岛市| 合山市| 锦屏县| 西青区| 金华市|