Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- Class Speenvarken {
- private $huidskleur;
- private $naam;
- private $gewicht;
- public function __construct($huidskleur, $naam, $gewicht){
- $this->huidskleur = $huidskleur;
- $this->naam = $naam;
- $this->gewicht = $gewicht;
- }
- public function getHuidskleur(){
- return $this->huidskleur;
- }
- public function getNaam(){
- return $this->naam;
- }
- public function getGewicht(){
- return $this->gewicht;
- }
- }
- $speenvarken = new Speenvarken('roze', 'Joey', '500');
- echo 'Er is een speenvarken genaamd ' . $speenvarken->getNaam() . '. Zijn huidskleur is ' . $speenvarken->getHuidskleur() . ' en hij weegt ' . $speenvarken->getGewicht() . ' kilo.';
- ?>
Advertisement
Add Comment
Please, Sign In to add comment