Abstract classes can be extended by other classes.
The functions and properties of abstract classes can be categorized in three ways:
1- If functions are defined as abstract, they do not have a body in the abstract class, and subclasses are required to override them.
2- If functions are defined as open, they can have a body in the abstract class. Subclasses may override these functions, but it is not mandatory.
3- If functions are defined as final, meaning they are neither abstract nor open, subclasses cannot modify them because final classes do not allow inheritance.
Summary: Abstract methods in abstract classes must be overridden, whereas open methods in open classes do not have to be overridden.
open
CAN be subclassed,abstract
MUST be subclassed. - Subclassing anabstract
class might require that some methods be implemented, whereas anopen
class, being able to be instantiated on its own, can always be trivially subclassed without modification. – Plumlee