<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ThinkChat2.0新版上線,更智能更精彩,支持會話、畫圖、視頻、閱讀、搜索等,送10W Token,即刻開啟你的AI之旅 廣告
                一、final指定某個類不允許被繼承或者是某個方法不允許被修改: 1、類A不允許類B繼承: final class A{ private $name; private $age; private $height; function __construct($a,$b,$c){ $this->name = $a; $this->age = $b; $this->height = $c; } final function show(){ return $this->height; } } class B extends A{ }//報錯: Class B may not inherit from final class (A)*/ 2、類A中的方法show不允許被重寫或修改: class A{ private $name; private $age; private $height; function __construct($a,$b,$c){ $this->name = $a; $this->age = $b; $this->height = $c; } final function show(){ return $this->height; } } $a = new A('zym','23歲','180cm'); echo $a->show(); class B extends A{ function show(){ return $this->name; } } $b = new B('zyy','24','172cm'); $b->show();//報錯: Cannot override final method A::show() 二、const指定類常量,僅限這個類進行調用,類的實例對象也不能調用: class A{ private $name; private $sex; const work = 'web前端開發'; function __construct($a,$b){ $this->name = $a; $this->sex = $b; } public function show(){ return $this->name.'的工作是'.self::work; } } $a = new A('fxxy','男'); echo $a->show();//fxxy的工作是web前端開發
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看