What is final class and final method?
It's properties can not 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.
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;
}
}
Suggest An Answer
No suggestions Available!