<?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 Reg : constructors n interfaces in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/reg-constructors-n-interfaces/m-p/4201164#M1004083</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;Why theses are only allowed to declare in PUBLIC SECTION?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 24 Jul 2008 07:14:09 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-07-24T07:14:09Z</dc:date>
    <item>
      <title>Reg : constructors n interfaces</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reg-constructors-n-interfaces/m-p/4201164#M1004083</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;Why theses are only allowed to declare in PUBLIC SECTION?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Jul 2008 07:14:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reg-constructors-n-interfaces/m-p/4201164#M1004083</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-24T07:14:09Z</dc:date>
    </item>
    <item>
      <title>Re: Reg : constructors n interfaces</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reg-constructors-n-interfaces/m-p/4201165#M1004084</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hii!&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;If you analyse the definition of constructor, they are automatically called at runtime with creation of runtime object. and your runtime object cannot access a private method directly.&lt;/P&gt;&lt;P&gt;I think, thats why they are declared in PUBLIC SECTION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And,&lt;/P&gt;&lt;P&gt; Interface components can only be accessed by using an object reference whose class implements the interface. and object reference cannot directly access the private components.&lt;/P&gt;&lt;P&gt;Thats why the interface name is listed in the definition part of the class with INTERFACES statement in PUBLIC SECTION.&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Abhijeet&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Jul 2008 07:39:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reg-constructors-n-interfaces/m-p/4201165#M1004084</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-24T07:39:01Z</dc:date>
    </item>
    <item>
      <title>Re: Reg : constructors n interfaces</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reg-constructors-n-interfaces/m-p/4201166#M1004085</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;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Interfaces&lt;/STRONG&gt; have only method signaturs or declaration not definition we have to define definition in the class which implements inteface .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and for &lt;STRONG&gt;Constructor:&lt;/STRONG&gt; When we create a object of a class then first it invokes the constructor of that class&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let say &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Class B{A a = new a(); the constructor of class A is invoked first,&lt;/P&gt;&lt;P&gt;so it is necessary to make constructors public bty default.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also have glance on this,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;" The definition of a constructor looks much like the definition of any other subroutine, with three exceptions. A constructor does not have any return type (not even void). The name of the constructor must be the same as the name of the class in which it is defined. The only modifiers that can be used on a constructor definition are the access modifiers public, private, and protected. (In particular, a constructor can't be declared static.)"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mohinder&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Jul 2008 07:51:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reg-constructors-n-interfaces/m-p/4201166#M1004085</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-24T07:51:45Z</dc:date>
    </item>
    <item>
      <title>Re: Reg : constructors n interfaces</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reg-constructors-n-interfaces/m-p/4201167#M1004086</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;@ Everyone : This is a mis-conception that constructors can not be declared as Private ones. Constructors can be Public or Private methods both.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check the article : &lt;A href="http://www.abaplearning.com/index.php?option=com_content&amp;amp;view=article&amp;amp;id=35:abap-objects-singleton-classes&amp;amp;catid=8:abap-objects&amp;amp;Itemid=13" target="test_blank"&gt;http://www.abaplearning.com/index.php?option=com_content&amp;amp;view=article&amp;amp;id=35:abap-objects-singleton-classes&amp;amp;catid=8:abap-objects&amp;amp;Itemid=13&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or Forum link : &lt;A href="http://www.abaplearning.com/index.php?option=com_fireboard&amp;amp;Itemid=2&amp;amp;func=view&amp;amp;id=14&amp;amp;catid=6" target="test_blank"&gt;http://www.abaplearning.com/index.php?option=com_fireboard&amp;amp;Itemid=2&amp;amp;func=view&amp;amp;id=14&amp;amp;catid=6&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Interfaces : &lt;/P&gt;&lt;P&gt;The interface methods are always public methods. This is because, the interface methods are called generally from outside the class.&lt;/P&gt;&lt;P&gt;A typical definition of interface is : "An interface defines the communication boundary between two entities, such as a piece of software, a hardware device, or a user. It generally refers to an abstraction that an entity provides of itself to the outside."&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So you can understand that the methods on an interface are generally called by the outside world... so they have to be Public only !.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Think about it ... you will get it .. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Jul 2008 17:12:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reg-constructors-n-interfaces/m-p/4201167#M1004086</guid>
      <dc:creator>former_member69765</dc:creator>
      <dc:date>2008-07-24T17:12:25Z</dc:date>
    </item>
    <item>
      <title>Re: Reg : constructors n interfaces</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reg-constructors-n-interfaces/m-p/4201168#M1004087</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;CONSTRUCTORS are usually public because a class instantiation is public by default (Properties tab in class builder). Change the class instantiation to private and you can make your CONSTRUCTOR private. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers, &lt;/P&gt;&lt;P&gt;Mike&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Jul 2008 07:12:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reg-constructors-n-interfaces/m-p/4201168#M1004087</guid>
      <dc:creator>pokrakam</dc:creator>
      <dc:date>2008-07-25T07:12:14Z</dc:date>
    </item>
    <item>
      <title>Re: Reg : constructors n interfaces</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reg-constructors-n-interfaces/m-p/4201169#M1004088</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;Unlike Classes there is no visiblity section in case of an Interface.&lt;/P&gt;&lt;P&gt;By default all the components in an Interface are of public scope. So, when we declare an interface in a &lt;/P&gt;&lt;P&gt;class we have to declare it in PUBLIC SECTION&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As a rule Constructors should be decalred in PUBLIC SECTION of a class.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this would help you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Murthy&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Jul 2008 07:21:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reg-constructors-n-interfaces/m-p/4201169#M1004088</guid>
      <dc:creator>former_member787646</dc:creator>
      <dc:date>2008-07-25T07:21:55Z</dc:date>
    </item>
    <item>
      <title>Re: Reg : constructors n interfaces</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reg-constructors-n-interfaces/m-p/4201170#M1004089</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;Constructors are special PUBLIC methods that are triggered when an object is instantiated from a class. They are necessary when you want to set the initial state of an object dynamically. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Like normal methods, there are two types of constructor - instance constructors and static constructors. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To use the instance constructor, the CONSTRUCTOR method must be declared in the public section of the class using the methods statement, and implemented in the implementation section.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Constructors must always be declared in the PUBLIC section of a class.	Executed once for each instance.it is  called automatically, immediately after the CREATE OBJECT statement..&lt;/P&gt;&lt;P&gt;It Can contain an interface with IMPORTING parameters and EXCEPTIONS , but cannot have any exporting/CHANGING/RETURNING parameters .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The interfaces are defined using the same syntax as for normal methods in the METHODS statement. To transfer parameters and handle exceptions, use the EXPORTING and EXCEPTIONS additions to the CREATE OBJECT statement .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Independent structures containing  definition  of its own components. &lt;/P&gt;&lt;P&gt;Incorporated in the public section of a class definition and the methods of the interface are implemented in the implementation section of that class. &lt;/P&gt;&lt;P&gt;Interfaces  are included in the public section of a class.&lt;/P&gt;&lt;P&gt;have an implementation part, since their methods are implemented in the class that implements the interface.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Jul 2008 07:17:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reg-constructors-n-interfaces/m-p/4201170#M1004089</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-29T07:17:07Z</dc:date>
    </item>
    <item>
      <title>Re: Reg : constructors n interfaces</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reg-constructors-n-interfaces/m-p/4201171#M1004090</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;interfacecomponents must be  declared as public components.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if  you do not do this ,&lt;/P&gt;&lt;P&gt;you risk the multiple implementations if a super class and sub class both implement the interface privately&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope this will clear your doubt.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; construcor must be declared as a public method because this method will be called after create object statement is executed by the runtime system.&lt;/P&gt;&lt;P&gt;if it a private method it has to be called by a public method which is practically not posiible and will not serve the purpose of construcottor&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope this will calrify your doubt&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Jul 2008 11:43:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reg-constructors-n-interfaces/m-p/4201171#M1004090</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-29T11:43:30Z</dc:date>
    </item>
  </channel>
</rss>

