Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Final concept

Former Member
0 Likes
497

Hi to all,

can any one explains me about final concept in oops?

Thanks

Priya

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
468

the class which has been given attribute final cannot be inherited

4 REPLIES 4
Read only

Former Member
0 Likes
469

the class which has been given attribute final cannot be inherited

Read only

Former Member
0 Likes
468

Hi Prema,

"FINAL" keyword denotes that it is the final implementation for that method or variable or class. You can’t override the FINAL method and you can not inherite the FINAL class.

Thanks,

Vinay

Read only

Former Member
0 Likes
468

Hello Priya,

you can prevent a class from being inherited by using the FINAL addition with the CLASS statement.

You can prevent a method from being redefined by using the FINAL addition with the METHODS statement.

The relevant indicator is in the Class Builder on the Attributes tab for that class or method.

CLASS lcl_... DEFINITION FINAL

..........................{ INHERITING FROM ... } . Inheritance from this class not possible

...

ENDCLASS.

CLASS lcl_... DEFINITION .

...

METHODS ... FINAL ... Method cannot be redefined

...

ENDCLASS.

All methods of a final class are implicitly final: therefore , you may not repeat the FINAL addition in the methods themselves.

Classes that are final should only contain static components.

Bye,

Peter

Read only

Former Member
0 Likes
468

Hi Priya,

Final means there is no sub attributes.

Regards

Srinu