Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

OOPS Syntax

SujeetMishra
Active Contributor
0 Likes
528

Hi All,

I am new on OOPS.

What is the difference between below syntax, when we use "->" and "=>"?

eg :lcl_airplane=>display_n_o_airplane( ).

and r_plane->set_attributes( im_name = 'AA New York'

im_planetype = '747-400' ).

Thanks in Advance.

Sujeet

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
486

Hi Sujeet,

'->' is used to call a instance method, in this case you have to create the instance of the class object. If you create a local class, methods created using the key word 'METHODS' will be called using '->'

'=>' is used to call a static method, in this case you do not have to create the instance of the class object. If you create a local class, methods created using key word 'CLASS-METHODS' will be called using '=>'.

Regards,

George

3 REPLIES 3
Read only

Former Member
0 Likes
486

hi Sujeet,

Instance methods are called using CALL METHOD <reference>-><instance_method>.

Static methods are called using CALL METHOD <classname>=><class_method>.

Static methods are addressed by class name, since they do not need instances.

Regards,

Runal

Read only

Former Member
0 Likes
487

Hi Sujeet,

'->' is used to call a instance method, in this case you have to create the instance of the class object. If you create a local class, methods created using the key word 'METHODS' will be called using '->'

'=>' is used to call a static method, in this case you do not have to create the instance of the class object. If you create a local class, methods created using key word 'CLASS-METHODS' will be called using '=>'.

Regards,

George

Read only

SujeetMishra
Active Contributor
0 Likes
486

Thanks