Anda di halaman 1dari 2

report z745oops2.

Local class with


methods (Class Implementation at the end)
class emp definition.
public section.
methods : m1,
m2.
protected section.
data : empno type i,
ename(20) type c.
endclass.

data k type ref to emp.


create object k.
*write :/ k->empno. "syntax error as empno is protected
write :/ 'Object k.....'.
call method k->m2.
call method k->m1.
call method k->m2.
data k1 type ref to emp.
create object k1.
uline.
write :/ 'Object k1.....'.
call method k1->m2.
class emp implementation.
method m1.
empno = 8.
ename = 'ravi'.

endmethod.
method m2.
*

write :/ me->empno,me->ename." 'me' referes to current object in execution (or)

write :/ empno,ename.
endmethod.
endclass.