0

Fill in the blanks to declare a class Student with a sayHi() method:

Student { public $name; public $age; public sayHi() { echo "Hi!"; } }

18th May 2019, 10:15 AM
Eric Nana Prekoh
14 Answers
+ 3
class Student { public $name; public $age; public function printData() { echo $this->name; echo $this ->age; } }
19th Dec 2020, 5:54 PM
El Maslohi Hassan
+ 1
function
21st May 2019, 10:18 PM
Shubham Tandale
Shubham Tandale - avatar
+ 1
Class Function
29th Jun 2019, 1:19 PM
Rahmat Hidayat
Rahmat Hidayat - avatar
0
Fill in the blanks to declare a class Student and a method that prints its name and age properties. Student { public $name; public $age; public function printData() { $this->name; echo ->age; } answer would be : // class, //echo, //$this understand this topic : <!DOCTYPE html> <html> <body> <?php class Fruit { // Properties public $name; public $color; // Methods function set_name($name) { $this->name = $name; } function get_name() { return $this->name; } } $apple = new Fruit(); $banana = new Fruit(); $apple->set_name('Apple'); $banana->set_name('Banana'); echo $apple->get_name(); echo "<br>"; echo $banana->get_name(); $blue = new Fruit (); $black = new Fruit (); $blue->set_name ("Egg"); echo $blue->get_name(); echo "<br>"; ?> </body> </html>
1st Mar 2020, 7:40 AM
Sadman Fahim
Sadman Fahim - avatar
0
class function
8th Apr 2020, 5:39 PM
Vatsal Shah
Vatsal Shah - avatar
0
class echo $this
8th Apr 2020, 5:43 PM
Vatsal Shah
Vatsal Shah - avatar
0
class echo $this This is the ans
9th Jul 2020, 8:39 PM
Faith Mundi
Faith Mundi - avatar
0
the answer class function
10th Dec 2020, 6:56 PM
Mostafa Alafif
Mostafa Alafif - avatar
0
echo
3rd Apr 2021, 6:02 AM
koshila
0
answer would be : // class, //echo, //$this
1st Sep 2021, 3:43 PM
MD Nur Ahmad
MD Nur Ahmad - avatar
0
Class Function
17th May 2022, 7:21 AM
Megha Raj kandel
0
class , echo and $this
17th May 2022, 7:24 AM
Megha Raj kandel
- 1
class Student { public $name; public $age; public function sayHi() { echo "Hi!"; } } // class //function
1st Mar 2020, 7:02 AM
Sadman Fahim
Sadman Fahim - avatar
- 1
Answer: static self ::
15th Mar 2021, 1:45 AM
Paul Chukura