Google Search - Blog...........

ABAP - OOPS: Final Classes Cannot Have Any Subclass.

REPORT YSUBDEL.

CLASS C1 DEFINITION FINAL.
ENDCLASS.

CLASS C1 IMPLEMENTATION .
ENDCLASS.

CLASS C2 DEFINITION INHERITING FROM C1.
ENDCLASS.

CLASS C2 IMPLEMENTATION.
endclass.

START-OF-SELECTION.
data : OREF2 TYPE REF TO C2.
CREATE OBJECT oref2.


Output

Compilation error is generated:-
The final class C1 cannot have any subclasses.

No comments:

Post a Comment