Final keyword.......
class b1 DEFINITION ABSTRACT.
PUBLIC SECTION.
methods:constructor.
ENDCLASS.
class b2 DEFINITION INHERITING FROM b1 .
PUBLIC SECTION.
methods:constructor.
ENDCLASS.
class b3 DEFINITION INHERITING FROM b2 FINAL.
PUBLIC SECTION.
METHODs: constructor.
ENDCLASS.
class b1 IMPLEMENTATION.
METHOD: constructor.
write:/ 'constuctor with abstract class'.
ENDMETHOD.
ENDCLASS.
class b2 IMPLEMENTATION.
METHOD:constructor.
CALL METHOD super->constructor.
WRITE :/ 'constructor abstract class and super keyword'.
ENDMETHOD.
ENDCLASS.
class b3 IMPLEMENTATION.
METHOD:constructor.
CALL METHOD super->constructor.
WRITE:/ 'Use of final keyword'.
ENDMETHOD.
ENDCLASS.
START-OF-SELECTION.
DATA: obj TYPE REF TO b3.
create OBJECT obj.
class b1 DEFINITION ABSTRACT.
PUBLIC SECTION.
methods:constructor.
ENDCLASS.
class b2 DEFINITION INHERITING FROM b1 .
PUBLIC SECTION.
methods:constructor.
ENDCLASS.
class b3 DEFINITION INHERITING FROM b2 FINAL.
PUBLIC SECTION.
METHODs: constructor.
ENDCLASS.
class b1 IMPLEMENTATION.
METHOD: constructor.
write:/ 'constuctor with abstract class'.
ENDMETHOD.
ENDCLASS.
class b2 IMPLEMENTATION.
METHOD:constructor.
CALL METHOD super->constructor.
WRITE :/ 'constructor abstract class and super keyword'.
ENDMETHOD.
ENDCLASS.
class b3 IMPLEMENTATION.
METHOD:constructor.
CALL METHOD super->constructor.
WRITE:/ 'Use of final keyword'.
ENDMETHOD.
ENDCLASS.
START-OF-SELECTION.
DATA: obj TYPE REF TO b3.
create OBJECT obj.
No comments:
Post a Comment