Oo
Oo
Object Orientaton :
1.Abstraction
2 Encapsulation
3)Inheritance
4)Polymorphism
---------------
1.Abstraction :
---------------
Represents only the essential features and hide the unneccesary
details,
to let every one enjoy the functionality with out understanding the internal
details.
ex : fm : gui_upload
-----------------
2)Encapsulation :
-----------------
can be accessed only by the subclasses and if reqd certain data can be protected.
-----------
Inheritance :
------------
(super/base class)one class completely re-used in other
class(sub class).
note : the subclass can re-implement the super class methods if reqd,and it can add
its own methods.
POLYMOPHISM :
-------------
poly--many
morphism---forms(implementations/functionalities)
CLASSES :
1)LOCAL CLASSES(se38)
2)GLOBAL CLASSES(se24)
LOCAL CLASSES :
PUBLIC/PRIVATE/PROTECTED.
METHODS : <x>,<y>.
ENDCLASS
METHOD <x>.
--
--
ENDMETHOD.
METHOD <y>.
--
--
ENDMETHOD.
ENDCLASS
START-OF-SELECTION.
CREATE OBJECT : <OBJ>.
CALL METHOD-><OBJ>-><x>,<y>.
GLOBAL CLASSES :
se24
ZGCL_CL
enter
methods :
add_any_tow_integers instance
multiply static
* for add_any_tow_integers
input1 inporting
input2 importing
result exporting
* for multiply
input1 inporting
input2 importing
result exporting
dc on method add_any_tow_integers
result = input1 + input2.
dc on method multiply
result = input1 * input2.
save&activate&F8&check
goto se38
WRITE :/ V_RESULT.
class/interface : zgcl_air_oprs
methods : add_any_two_ints
enter
me is default object
CONSTRUCTOR :
-------------
when the name of the method is constructor it is called automatically at the time
of creating
object itself and it is used to construct the object with the initial values in
general
note : constructor should be always public and it can have only importing
parameters.
create a class in se 24
zgcl_customer
in methods
DC ON CREATE METHOD
DC ON CHANGE METHOD
DC ON DISPLAY METHOD
CONSTRUCTOR IS CREATED
parameters