-
-
Save pavanBS/9ed1543c46684f2d579b7a4a83cff06c to your computer and use it in GitHub Desktop.
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 | |
abstract class Cars { | |
public abstract function getCompanyName(); | |
public abstract function getPrice(); | |
} | |
class Baleno extends Cars { | |
public function getCompanyName() { | |
return "Maruthi Suzuki" . '<br/>'; | |
} | |
public function getPrice() { | |
return 720000 . '<br/>'; | |
} | |
} | |
class Santro extends Cars { | |
public function getCompanyName() { | |
return "Hyundai" . '<br/>'; | |
} | |
public function getPrice() { | |
return 300000 . '<br/>'; | |
} | |
} | |
$car = new Baleno(); | |
$car1 = new Santro(); | |
echo $car->getCompanyName(); | |
echo $car->getPrice(); | |
echo $car1->getCompanyName(); | |
echo $car1->getPrice(); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment