#php #pemograman-berorientasi-objek-di-php #dasar-pemograman-berorientasi-objek-pbo-di-php
Petunjuk Diskusi
class Handphone { public $kamera; public $tahun; public $layar_sentuh = true; public function __construct($kamera, $tahun) { $this->kamera=$kamera; $this->tahun=$tahun; } public function ambil_photo() { return "$this->kamera jepret..!!"; } } $canggih = new Handphone("Kamera: 8 Megapixels", "Tahun : 2013"); $jadul = new Handphone("Kamera: 2 Megapixels", "Tahun : 2012"); $jadul->layar_sentuh=false; echo $canggih->ambil_photo();
0 jempol