You can move member definitions (for example, constants, attributes, methods, types, and events) from a subclass and to its superclass.
Example
Before Execution | After Execution |
---|---|
To copy the source code example, click here Code Example Before Execution |
|
The cl_car class contains the speed attribute and implements the cl_vehicle superclass. |
The declarion of the speed attribute has been removed from the cl_car class and added to the cl_vehicle superclass. The visibility of the attribute has been changed from private to protected in order to make it available for the cl_car subclass. |