Anda di halaman 1dari 1

report z745oops12.

Initializing
attributes of class inside constructor
class emp definition.
public section.
methods : constructor,
m2.
protected section.
data : empno type i,
ename(20) type c.
endclass.
class emp implementation.
method constructor.
empno = 4.
ename = 'Ravi'.
endmethod.
method m2.
write :/ empno,ename.
endmethod.
endclass.
start-of-selection.
data ob type ref to emp.
create object ob.
call method : ob->m2.