|Home • Trainings • Quiz • Tips • Tutorials • Functional • Cert Q's • Interview Q's • Jobs • Testimonials • Advertise • Contact Us|
Final Classes and Methods in Object Oriented Programming
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
"Attributes" tab, check the check box "Final" and then press
A successful message is
displayed like "Method changed successfully"
Write the below code in
Then save and activate the
class and method.
b) Creating Sub Class:
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
Enter the Description of
the class and then select the inheritance button
to inherit the super class.
Enter the Super class name
as "Z_DEMO_SUP_CLASS", which is being created earlier and press
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
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
Same as sub class, you can
also execute the super class "Z_DEMO_SUP_CLASS", the same output will
Please send us your feedback/suggestions at webmaster@SAPTechnical.COM
©2006-2007 SAPTechnical.COM. All rights reserved.
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