mvsp

aula 11.php

Jul 22nd, 2021
26
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.  
  3. class Animal{
  4.     public function Andar(){
  5.         echo "O animal andou";
  6.     }
  7.  
  8.     public function Correr(){
  9.         echo "O animal correu";
  10.     }
  11. }
  12.  
  13. class Cavalo extends Animal{
  14.     public function Andar(){
  15.         echo "O cavalo andou"."<br>";
  16.         $this->Correr();
  17.     }
  18. }
  19.  
  20.  
  21. $animal = new Cavalo();
  22. $animal->Andar();
RAW Paste Data