| Home • Tips • Tutorials • Forums • Certification Q's • Interview Q's • Jobs • Testimonials • Contact Us | ||
Document Categories:
What's New?
Contribute?Sample SpecsWhat's Hot? |
Final Classes and Methods in Object Oriented ProgrammingBy Dharani Prasanna, IBM India Final
Class: A class that
is defined as final class can not be inherited further. All Methods of a final
class are inherently final and must not be declared as final in the class
definition. Also, a final method can not be redefined further. Step-by-Step Approach to create Final classes and Methods Final Class: TCode: SE24 Enter the name of class as
'Z_DEMO_FINAL_CLASS' and press Create Button
A pop-up window is
displayed, then select "Class" radio button and Press enter
Enter the Description of
the class and select the check box "Final" to define the class as
Final class, and then press enter
Go to the
"Attributes" tab, Enter the Attribute name,
Level, Visibility, Type and Description as shown in the screen shot.
Go to Methods tab, Enter Method name, Level,
Visibility and Description as shown in the below screen shot
Double click on the Method
name "METH"; it goes to method Implementation screen. Here write the code.
Write the following code in
method meth Method
meth * Local Data Declarations Endmethod. Then save and activate the
class and method. Finally execute the class
by pressing
It goes to below screen,
then enter value under "NUMBER" as "19" and Press execute button
The output will be
displayed like below.
Final Method: a)
Creating Super Class: TCode: SE24 Enter the name of class as
'Z_DEMO_SUP_CLASS' to create super class and then press "Create"
Button
A pop-up window is
displayed, then select "Class" radio button and Press enter
Enter the Description of
the class and then press enter
Go to the
"Attributes" tab, Enter the Attribute name,
Level, Visibility, Type and Description as shown in the screen shot.
|
|
|
Please send us your feedback/suggestions at webmaster@SAPTechnical.COM Home • Contribute • About Us • Privacy • Terms Of Use • Disclaimer • Safe • Companies: Advertise on SAPTechnical.COM | Post Job • Contact Us ©2006-2007 SAPTechnical.COM. All rights reserved. All
product names are trademarks of their respective companies. SAPTechnical.COM
is in no way affiliated with SAP AG. Graphic Design by Round the Bend Wizards |
||