Created
June 27, 2017 13:50
-
-
Save purwadarozatun/2e4806ee5573b22a098af742e711bbdf to your computer and use it in GitHub Desktop.
OPP INTRO
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Gelas | |
{ | |
protected $bahan; | |
protected $nama; | |
protected $warna; | |
function __construct($nama, $bahan , $warma){ | |
$this->nama = $nama; | |
$this->bahan = $bahan; | |
$this->warma = $warma; | |
} | |
} | |
$objectGelasMerah = new Gelas('Gelas Merah', 'Plastik', 'Merah'); | |
$objectGelasHIjau = new Gelas('Gelas Hijau', 'Plastik', 'Hijau'); | |
echo("Ini ". $objectGelasMerah->nama. " Dengan Bahan : " . $objectGelasMerah->bahan." Dan warna : " . $objectGelasMerah->warna); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment