Final Keyword Can Be Used To Declare A Class Uninheritable

<?
    final class Dog {
            private $Name;
            public function getName( ) {
                    return $this->Name;
            }
    }    class Poodle extends Dog {
            public function bark( ) {
                    print "'Woof', says " . $this->getName( );
            }
    }
?>

Enjoyed this post? Share it!

 

Leave a comment

Your email address will not be published.