05-27-2009 7:01 AM
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
05-27-2009 8:02 AM
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
05-27-2009 7:05 AM
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
05-27-2009 8:02 AM
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
05-27-2009 8:09 AM