What are the final class and final method?
Its properties cannot be declared final, only classes and methods may be declared as final. If the class or method defined as final, then it cannot be extended.
BY Best Interview Question ON 03 Jul 2020
Example
class childClassname extends parentClassname {
protected $numPages;
public function __construct($author, $pages) {
$this->_author = $author;
$this->numPages = $pages;
}
final public function PageCount() {
return $this->numPages;
}
}