+ 2
PHP last quiz
Can anybody please help me with the answers, 1st one is class but cant Find the other 3? fill in the blanks to declare a class singer having a display method that outputs the name. than, create an object of the class and call the display method? ______singer{ Public $name = “Ann”; Public funtion display(){ Echo_______->name; } } $s =____singer(); $s___display();
7 Réponses
+ 3
Singer {
public $name = "Ann";
public function display() {
echo
->name;
}
}
$s =
Singer();
$s
display();
+ 1
interface
MusicianInterface {
public function play();
}
class Guitarist
implements
MusicianInterface {
public function play() {
echo "La La La";
}
}
$obj = new Guitarist();
$obj->play();
0
<?php
class singer{
public $name = "Ann";
public function display(){
echo $this->name;
}
}
$s = new singer();
$s->display();
0
thanks mate
0
Answer is
class
$this
new
->
0
- 1
<?php
class singer{
public $name = "Ann";
public function display(){
echo $this->name;
}
}
$s = new singer();
$s->display();