本帖最后由 neverfailor 于 2010-02-17 19:20:50 编辑

解决方案 »

  1.   

        public function __construct($power = '', $box = '')
          {
              parent::__construct();
              $this->power = $power;
              $this->box = $box;
          }
    //没有传入参数public function __construct($processor = '', $mainboard = '', $memory = '', $hdisk = '', $cdrom = '', $graphic = '',$power = '', $box = '') {
    parent::__construct ($processor , $mainboard , $memory , $hdisk , $cdrom, $graphic );
    $this->power = $power;
    $this->box = $box;
    }
      

  2.   

    可以直接继承 但是$this->power = $power; $this->box = $box;要另外赋值了 不能放在__construct里了