随笔 - 78  文章 - 25  trackbacks - 0
<2009年6月>
31123456
78910111213
14151617181920
21222324252627
2829301234
567891011

常用链接

留言簿

随笔分类(75)

随笔档案(78)

相册

实用Links

我的Links

搜索

  •  

积分与排名

  • 积分 - 112050
  • 排名 - 519

最新评论

阅读排行榜

评论排行榜

<?php
    class BaseClass{
        function __construct(){
            echo "<br><font color=red>this is the base class constructor</font><br>";
        }
    }
    class SubClass extends BaseClass{
        function __construct(){
#子类调用父类构造方法的两种,父类名::__construct();parent::__construct()
            BaseClass::__construct();
            parent::__construct();
            echo" <br> this is the sub class constructor<br>";
        }
    }
    echo "declare an instance of BaseClass<br>";
    $obj=new BaseClass();

    echo "declare an instance of SubClass<br>";
    $obj1=new SubClass();
?>
posted on 2009-06-28 13:34 期待明天 阅读(396) 评论(0)  编辑  收藏 所属分类: PHP

只有注册用户登录后才能发表评论。


网站导航: