August 2013
Intermediate to advanced
140 pages
1h 49m
English
CHAPTER 15
![]()
Abstract
An abstract class provides a partial implementation that other classes can build upon. When a class is declared as abstract it means that the class can contain incomplete methods that must be implemented in child classes, in addition to normal class members.
Abstract methods
In an abstract class any method can be declared abstract. These methods are then left unimplemented and only their signatures are specified, while their code blocks are replaced by semicolons.
abstract class Shape{ abstract public function myAbstract();}
Abstract example
To give an example, the class below has two properties and an abstract method.
Read now
Unlock full access