In a subclass sub1, you want to redefine a component of a superclass super1.
How do you achieve this?
Note: There are 2 correct answers to this question.
To redefine a component in a subclass:
The component (method) in the superclass must be defined with the FOR REDEFINITION addition.
In the subclass, you use the REDEFINITION clause in the method declaration and implement the method in the subclass to override the superclass behavior.
Thus:
Option A is correct because the method declaration in sub1 must include the REDEFINITION addition.
Option D is correct because the actual redefined method implementation must be provided in the subclass sub1.
Option B is incorrect because the component is not re-implemented in the superclass.
Option C is incorrect because REDEFINITION is not added in the superclass, but FOR REDEFINITION is.
===========
Currently there are no comments in this discussion, be the first to comment!