Académique Documents
Professionnel Documents
Culture Documents
Definition: The methods of the super class can be re-implemented at the sub class.
Purpose to redefine methods: if the method implementation at the super class is not satisfies
the requirement of the object which is created with reference to the sub class.
Principles of redefining methods:
1. The REDEFINITION statement for the inherited method must be in the same SECTION
as the definition of the original method.
2. If you redefine a method, you do not need to enter its interface again in the subclass,
but only the name of the method.
3. In the case of redefined methods, changing the interface (overloading) is not
permitted; exception: Overloading is possible with the constructor
4. Within the redefined method, you can access components of the direct super class
using the SUPER reference.
5. The pseudo-reference super can only be used in redefined methods.
Demo program for redefining method:
Go to transaction SE38:
Give any name for the program.
Result:
Go to transaction SE38.
Result: