Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- interface Ikontrol{
- public function construct();
- public function Berjalan();
- public function Berhenti();
- }
- class Mobil implements Ikontrol {
- public $perintah;
- public function construct() {
- echo $this->perintah = "Mobil Dapat";
- }
- public function Berjalan() {
- echo $this->perintah = "berjalan dengan tuas gas";
- }
- public function Berhenti() {
- echo $this->perintah = "Berhenti dengan Tuas Rem";
- }
- public function infoKontrol() {
- echo $this->construct();
- echo "</br>";
- echo $this->Berjalan();
- echo "</br>";
- echo $this->Berhenti();
- }
- }
- $mobil = new Mobil();
- $mobil->infoKontrol();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement