You are on page 1of 1

REPORT ZCLASS_OOPS1.

class lcl_main DEFINITION.


PUBLIC SECTION.
data i1 type i. " instance
class-data i2 type i. " static attribute
endclass.
data obj1 TYPE REF TO lcl_main.
CREATE OBJECT obj1.
" 0
0
obj1->i1 = 100.
"100 200
lcl_main=>i2 = 200.
WRITE:/ obj1->i1 , lcl_main=>i2.
data obj2 TYPE REF TO lcl_main.
CREATE OBJECT obj2.
"0
obj2->i1 = 11.
"11
lcl_main=>i2 = 22.
WRITE:/ obj2->i1 , lcl_main=>i2.
WRITE:/ obj1->i1 , lcl_main=>i2.

200
22
" 11
22
" 100 22