<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: overloading &amp; overriding in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/overloading-overriding/m-p/2285998#M498153</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;) In overloading, there is a relationship between methods available in the same class whereas in overriding, there is relationship between a superclass method and subclass method.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;b) Overloading does not block inheritance from the superclass whereas overriding blocks inheritance from the superclass.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;c) In overloading, separate methods share the same name whereas in overriding, subclass method replaces the superclass.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;d) Overloading must have different method signatures whereas overriding must have same signature.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 29 May 2007 11:52:49 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-05-29T11:52:49Z</dc:date>
    <item>
      <title>overloading &amp; overriding</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/overloading-overriding/m-p/2285997#M498152</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi guru&lt;/P&gt;&lt;P&gt;what is difference between overloading &amp;amp; overriding&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;subhasis.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 May 2007 11:48:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/overloading-overriding/m-p/2285997#M498152</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-29T11:48:02Z</dc:date>
    </item>
    <item>
      <title>Re: overloading &amp; overriding</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/overloading-overriding/m-p/2285998#M498153</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;) In overloading, there is a relationship between methods available in the same class whereas in overriding, there is relationship between a superclass method and subclass method.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;b) Overloading does not block inheritance from the superclass whereas overriding blocks inheritance from the superclass.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;c) In overloading, separate methods share the same name whereas in overriding, subclass method replaces the superclass.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;d) Overloading must have different method signatures whereas overriding must have same signature.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 May 2007 11:52:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/overloading-overriding/m-p/2285998#M498153</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-29T11:52:49Z</dc:date>
    </item>
    <item>
      <title>Re: overloading &amp; overriding</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/overloading-overriding/m-p/2285999#M498154</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Subhasish,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLASS zl_lcl_vehicle DEFINITION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  PUBLIC SECTION.&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;* Signature of method&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;    METHODS: set_make&lt;/P&gt;&lt;P&gt;                IMPORTING value(im_make) TYPE string " Pass by value&lt;/P&gt;&lt;P&gt;                          im_model       TYPE string," Pass by reference             &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDCLASS.                    "zl_lcl_vehicle DEFINITION&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLASS zl_lcl_vehicle IMPLEMENTATION.&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;* Implementation of method.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;  METHOD set_make.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    IF im_make  IS NOT INITIAL&lt;/P&gt;&lt;P&gt;       AND im_model IS NOT INITIAL.&lt;/P&gt;&lt;P&gt;      gv_make  = im_make.&lt;/P&gt;&lt;P&gt;      gv_model = im_model.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ENDMETHOD.                    "set_make&lt;/P&gt;&lt;P&gt;ENDCLASS.               "zl_lcl_vehicle&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;u&amp;gt;&amp;lt;b&amp;gt;Overloading&amp;lt;/b&amp;gt;&amp;lt;/u&amp;gt; means changing signature as well as implementation of a method. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;u&amp;gt;&amp;lt;b&amp;gt;Overriding&amp;lt;/b&amp;gt;&amp;lt;/u&amp;gt; is changing only implementation of method with signature unchanged.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;From ABAP perspective, &amp;lt;b&amp;gt;only the CONSTRUCTOR method can be overloaded&amp;lt;/b&amp;gt; in a subclass i.e both the signature and implementation can be adapted in subclass.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any other method can't be overloaded. It can only be redefined/overridden i.e implementation changed with signature unchanged. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Award points if found useful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Indrajit.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 May 2007 11:58:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/overloading-overriding/m-p/2285999#M498154</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-29T11:58:50Z</dc:date>
    </item>
    <item>
      <title>Re: overloading &amp; overriding</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/overloading-overriding/m-p/2286000#M498155</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think the definition of overloading is &amp;lt;u&amp;gt;having a different set of parameters for the same method&amp;lt;/u&amp;gt;. In other languages, multiple methods are allowed to be created with the same name but with different parameters. In ABAP Objects, this is not allowed. However, the same effect can be recreated by ABAP Objects via the keyword OPTIONAL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Overriding on the other hand basically is &amp;lt;u&amp;gt;redefining a method in a subclass previously defined in its superclass&amp;lt;/u&amp;gt;. In ABAP Objects, only the implementation part is allowed to be overridden. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, I think its fair to say, in ABAP Objects, all methods can be (to some degree) be overridden and overloaded. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Constructors, can be overloaded and overridden also. Constructors are a bit special though in terms of inheritance. You can redefine both the definition and the implementation. However, (this bothers me) you must call super-&amp;gt;constructor inside the overriding constructor.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Aug 2007 17:23:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/overloading-overriding/m-p/2286000#M498155</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-08T17:23:27Z</dc:date>
    </item>
  </channel>
</rss>

