Overriding Methods

<?
    class Dog {
            public function bark( ) {
                    print "Woof!\n";
            }
    }    class Poodle extends Dog {
            public function bark( ) {
                    print "Yip!\n";
            }
    }
?>

Enjoyed this post? Share it!

 

Leave a comment

Your email address will not be published.