| 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 Programming...Previous Go to Methods tab, Enter Method name, Level,
Visibility and Description as shown in the below screen shot
Double click on the Method
name "VOLUM"; it goes to method Implementation screen. As shown below
To define method "VOLUM"
as a Final method, Go to Menu path, then Goto
-> Method definition
Pop-up window is displayed Go to
"Attributes" tab, check the check box "Final" and then press
"Change" button.
A successful message is
displayed like "Method changed successfully"
Write the below code in
Method volum METHOD volum.
Then save and activate the
class and method. b)
Creating Sub Class: TCode: SE24 Enter the name of class as
'Z_DEMO_SUB_CLASS' and press Create Button to create sub class
A pop-up window is
displayed, then select "Class" radio button and Press enter
Enter the Description of
the class and then select the inheritance button
Enter the Super class name
as "Z_DEMO_SUP_CLASS", which is being created earlier and press
"Save" button.
The Attributes and methods
defined in the super class will automatically come into the sub class. If you try to redefine or
modify the super class method "VOLUM", go to the Methods tab, select
the "VOLUM" method and click on "Redefine" button
It gives a message like
below and not allowed to redefine or modify the method in sub class.
The method implementation
"VOLUM" can be used in both super class "Z_DEMO_SUP_CLASS"
and sub class "Z_DEMO_SUB_CLASS". Execute the sub class
"Z_DEMO_SUB_CLASS" by pressing
It goes to below screen,
then enter values under "LENGTH, HEIGHT and WIDTH" as "2, 3 and
4" and Press execute button
The output will be displayed
like below.
Same as sub class, you can
also execute the super class "Z_DEMO_SUP_CLASS", the same output will
be displayed. |
|
|
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 |
||