<?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 Static Interface Methods in ABAP in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/static-interface-methods-in-abap/m-p/875109#M50531</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'd like to know what sense it makes to define static methods in an interface. &lt;/P&gt;&lt;P&gt;My understanding is, that an interface can only be used with an instance of a class implementing that interface. So I always need to have an instance and thus, static methods are not needed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But ABAP-OO (in contrast to Java, for example) allows that, so maybe there is some need for that?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your help, best regards,&lt;/P&gt;&lt;P&gt;Timo Wolf.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 01 Feb 2005 10:29:15 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2005-02-01T10:29:15Z</dc:date>
    <item>
      <title>Static Interface Methods in ABAP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/static-interface-methods-in-abap/m-p/875109#M50531</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'd like to know what sense it makes to define static methods in an interface. &lt;/P&gt;&lt;P&gt;My understanding is, that an interface can only be used with an instance of a class implementing that interface. So I always need to have an instance and thus, static methods are not needed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But ABAP-OO (in contrast to Java, for example) allows that, so maybe there is some need for that?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your help, best regards,&lt;/P&gt;&lt;P&gt;Timo Wolf.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Feb 2005 10:29:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/static-interface-methods-in-abap/m-p/875109#M50531</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-02-01T10:29:15Z</dc:date>
    </item>
    <item>
      <title>Re: Static Interface Methods in ABAP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/static-interface-methods-in-abap/m-p/875110#M50532</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;As you know that static methods are not instance- specific. Hence when a class implements an interface, the methods defined as static do not require an instance-specific call. Rather they are called as CLASSNAME=&amp;gt;INTREFACE_NAME~STATIC_METHOD_NAME. You do not need an instance to access them. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The only purpose of declaring a method as STATIC in interface definition is to create an agreement that a particular method will not depend on an instance to work. When a class implements the interface, calls to this method will be as mentioned above.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;&lt;/P&gt;&lt;P&gt;As far as the static components of interfaces are concerned, you can only use the interface name to access constants:&lt;/P&gt;&lt;P&gt;Addressing a constant &amp;lt;const&amp;gt;: &amp;lt;intf&amp;gt;=&amp;gt;&amp;lt;const&amp;gt;&lt;/P&gt;&lt;P&gt;For all other static components of an interface, you can only use object references or the class &amp;lt;class&amp;gt; that implements the interface:&lt;/P&gt;&lt;P&gt;Addressing a static attribute &amp;lt;attr&amp;gt;: &amp;lt;class&amp;gt;=&amp;gt;&amp;lt;intf~attr&amp;gt;&lt;/P&gt;&lt;P&gt;Calling a static method &amp;lt;meth&amp;gt;: CALL METHOD &amp;lt;class&amp;gt;=&amp;gt;&amp;lt;intf~meth&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Shehryar Khan&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Shehryar Khan&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Feb 2005 10:52:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/static-interface-methods-in-abap/m-p/875110#M50532</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-02-01T10:52:50Z</dc:date>
    </item>
  </channel>
</rss>

