锘??xml version="1.0" encoding="utf-8" standalone="yes"?>日韩在线观看不卡,综合一区av,蜜桃免费在线http://www.aygfsteel.com/devliu1986/zh-cnThu, 17 Jul 2025 04:11:57 GMTThu, 17 Jul 2025 04:11:57 GMT60when upcasting .....http://www.aygfsteel.com/devliu1986/archive/2008/05/25/202762.htmldevliudevliuSun, 25 May 2008 11:40:00 GMThttp://www.aygfsteel.com/devliu1986/archive/2008/05/25/202762.htmlhttp://www.aygfsteel.com/devliu1986/comments/202762.htmlhttp://www.aygfsteel.com/devliu1986/archive/2008/05/25/202762.html#Feedback0http://www.aygfsteel.com/devliu1986/comments/commentRss/202762.htmlhttp://www.aygfsteel.com/devliu1986/services/trackbacks/202762.html 1// codes start
 2class base{//a base class
 3
 4// constructor
 5public base(){
 6System.out.println("base class construct");
 7}

 8// perform
 9public void perform(){
10System.out.println("base class perform");
11}

12// destructor
13public void finalize(){
14System.out.println("base class destruct");
15}

16}

17
18
19class subbase extends base{// derive from base
20
21// constructor
22public subbase(){
23System.out.println("sub class construct");
24}

25// perform
26public void perform(){
27System.out.println("sub class perform");
28}

29// destructor
30public void finalize(){
31System.out.println("sub class destruct");
32}

33}

34
35public class casting{// test casting class
36// constructor
37public casting(){
38System.out.println("begin casting test");
39}

40
41public static void main(String args[]){
42base father = new base();
43subbase son = new subbase();
44
45father.perform();
46son.perform();
47
48father = (base)son; // <1>
49father.perform();
50
51son = (subbase)father; // <2>
52son.perform();
53
54father = (base)((subbase)father); // <3>
55father.perform();
56}

57}

58
59// codes end
60 Today ,when i go for a interview ,the project manager asked me this question !
Acturally ,It's just relate to the knowledge of reference &&  object !
Be carefull ,Nothing !

devliu 2008-05-25 19:40 鍙戣〃璇勮
]]>
主站蜘蛛池模板: 鲁甸县| 江川县| 仁怀市| 崇义县| 阿鲁科尔沁旗| 福州市| 晴隆县| 深州市| 邹平县| 平顶山市| 浦城县| 泗水县| 潜江市| 濮阳市| 万年县| 陈巴尔虎旗| 黄山市| 新建县| 乐昌市| 金乡县| 辽阳县| 永靖县| 汤阴县| 富阳市| 巴马| 丰都县| 彩票| 泸州市| 房产| 靖江市| 中宁县| 天台县| 蕲春县| 曲靖市| 油尖旺区| 新干县| 新昌县| 绥棱县| 靖宇县| 衡水市| 台北县|