Question: Study the classes below: class A { protected $name, $id; private static $number = 1 ; public function _ _ construct ( $na ) {
Study the classes below:
class A
protected $name, $id;
private static $number ;
public function construct$na
$thisname $na;
$thisid self::$number;
self::$number;
public function setName$na
$thisname $na;
public function getName
return $thisname;
public function getID
return $thisid;
public function toString
return $thisname,$thisid;
class B extends A
protected $type;
public function construct$na $ty
$thistype $ty;
parent::construct$na;
public function setType$ty
$thistype $ty;
public function getType
return $type;
public function toString
return parent::toString$thistype;
Which one of the following options is correct for the code above?
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
