0
Fill in the blanks to declare a class Singer having a display method that outputs the name. Then, create an object of the class
Fill in the blanks to declare a class Singer having a display method that outputs the name. Then, create an object of the class and call the display method. class Singer { public $name = "Ann"; public function display() { echo $this ->name; } } $s = new Singer(); $s что сюда дописать помогите display();
17 ответов
+ 4
This question right answer:
class
$this
new
->
+ 3
Fill in the blanks to define a class Singer that inherits from the Musician class.
class Musician
{
public $name;
public function toPlay() {
echo "Playing on piano";
}
}
class Singer extends Musician {
}
+ 2
class Singer {
static
$name = "Jone";
static function toSing() {
echo self::$name;
}
}
Singer::toSing();
+ 1
class Singer {
public $name = "Ann";
public function display() {
echo
$this->name;
}
}
$s = newSinger();
$s->Singer();
+ 1
https://www.youtube.com/channel/UC2TmzHkWeKpEXnYxRAHdjIQ
static
self
::
0
static
self
::
0
class Singer {
static
$name = "Jone";
static function toSing() {
echo self::$name;
}
}
Singer :: toSing();
0
Here is the solution to:
Fill in the blanks to define a class Singer that inherits from the Musician class.
class Musician
{
public $name;
public function toPlay() {
echo "Playing on piano";
}
}
class
Singer
extends
Musician {
}
0
$ , class and extends
0
static
self
::
0
class
$this
new
->
0
class
Singer {
public $name = "Ann";
public function display() {
echo
$this
->name;
}
}
$s =
new
Singer();
$s
->
display();
0
class Singer {
public $name = "Ann";
public function display() {
echo $this -> name;
}
}
$s = new Singer();
$s -> display();
0
Fill in the blanks to define the Guitarist class that implements the MusicianInterface. Call the play() method on the Guitarist object.
??????
- 1
class
Singer {
public $name = "Ann";
public function display() {
echo
$this
->name;
}
}
$s =
new
Singer();
$s
->
display();
- 1
class
Singer {
public $name = "Ann";
public function display() {
echo
$this
->name;
}
}
$s =
new
Singer();
$s
->
display();