#php #pemograman-berorientasi-objek-di-php #dasar-pemograman-berorientasi-objek-pbo-di-php
Petunjuk Diskusi
class Kucing { public $lucu = true; public $warna; public function __construct($warna) { $this->warna= $warna; } public function meong() { return "Meong..!!"; } public function menyapa() { return "Hai, saya si $this->warna." ; } }; $putih = new kucing ("putih"); $hitam = new kucing ("hitam"); echo $hitam -> menyapa (); echo $putih -> meong ();
0 jempol