#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; } function ambil_photo(){ return "$this->kamera jepret..!!"; } } $canggih = new Handphone('8 Megapixels',2013); $jadul = new Handphone('2 Megapixels',2012); $jadul->layar_sentuh = false; echo $canggih->ambil_photo();
0 jempol