Guest User

Speenvarken biatch

a guest
May 28th, 2012
34
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. <?php
  2. Class Speenvarken {
  3. private $huidskleur;
  4. private $naam;
  5. private $gewicht;
  6.  
  7. public function __construct($huidskleur, $naam, $gewicht){
  8. $this->huidskleur = $huidskleur;
  9. $this->naam = $naam;
  10. $this->gewicht = $gewicht;
  11. }
  12.  
  13. public function getHuidskleur(){
  14. return $this->huidskleur;
  15. }
  16.  
  17. public function getNaam(){
  18. return $this->naam;
  19. }
  20.  
  21. public function getGewicht(){
  22. return $this->gewicht;
  23. }
  24. }
  25.  
  26. $speenvarken = new Speenvarken('roze', 'Joey', '500');
  27.  
  28. echo 'Er is een speenvarken genaamd ' . $speenvarken->getNaam() . '. Zijn huidskleur is ' . $speenvarken->getHuidskleur() . ' en hij weegt ' . $speenvarken->getGewicht() . ' kilo.';
  29. ?>
Advertisement
Add Comment
Please, Sign In to add comment