<?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: Constructors in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/constructors/m-p/3060491#M724911</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;   Refer&lt;/P&gt;&lt;P&gt;&lt;A href="http://java.sun.com/docs/books/tutorial/java/TOC.html" target="test_blank"&gt;http://java.sun.com/docs/books/tutorial/java/TOC.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Assume that all the three classes have their own static and Instance constructors.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Case 1. When class A is instantiated.&lt;/P&gt;&lt;P&gt;First the Static constructor of A will be called, then the Instance Constructor.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Case 2. When class B is instantiated&lt;/P&gt;&lt;P&gt;First the Static constructor of the Class B will be called, then the Instance Constructor. One has to explicitly call the construcotrs of class A in the contructors of class B. If constructors of class A are not called (Constructor of Super class is called by SUPER-&amp;gt;Constructor in the sub-class constrcutor) in the sub class, then they are not executed. If they are called, then Static constructor of class A will be called first, then Instance Constructor.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Case 3. Whne Class C is instantiated.&lt;/P&gt;&lt;P&gt;Same as Case 2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 19 Nov 2007 09:58:40 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-11-19T09:58:40Z</dc:date>
    <item>
      <title>Constructors</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/constructors/m-p/3060488#M724908</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 am not very clear with the Constructor Concept.Please brief me about the Static &amp;amp; Instance Constructors.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Nov 2007 08:16:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/constructors/m-p/3060488#M724908</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-11-19T08:16:08Z</dc:date>
    </item>
    <item>
      <title>Re: Constructors</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/constructors/m-p/3060489#M724909</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Check here...&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.erpgenie.com/abap/OO/defn.htm" target="test_blank"&gt;http://www.erpgenie.com/abap/OO/defn.htm&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Nov 2007 08:21:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/constructors/m-p/3060489#M724909</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-11-19T08:21:34Z</dc:date>
    </item>
    <item>
      <title>Re: Constructors</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/constructors/m-p/3060490#M724910</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi sneha,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Constructor method&amp;lt;/b&amp;gt; &lt;/P&gt;&lt;P&gt;Implicitly, each class has an instance constructor method with the reserved name constructor and a static constructor method with the reserved name class_constructor. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The instance constructor is executed each time you create an object (instance) with the CREATE OBJECT statement, while the class constructor is executed exactly once before you first access a class. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The constructors are always present. However, to implement a constructor you must declare it explicitly with the METHODS or CLASS-METHODS statements. An instance constructor can have IMPORTING parameters and exceptions. You must pass all non-optional parameters when creating an object. Static constructors have no parameters. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Static constructor&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The static constructor is always called CLASS_CONSTRUCTER, and is called autmatically before the clas is first accessed, that is before any of the following actions are executed:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Creating an instance using CREATE_OBJECT &lt;/P&gt;&lt;P&gt;Adressing a static attribute using &amp;lt;classname&amp;gt;-&amp;gt;&amp;lt;attrbute&amp;gt; &lt;/P&gt;&lt;P&gt;Calling a ststic attribute using CALL METHOD &lt;/P&gt;&lt;P&gt;Registering a static event handler &lt;/P&gt;&lt;P&gt;Registering an evetm handler method for a static event &lt;/P&gt;&lt;P&gt;The static constructor cannot be called explicitly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Hope this is helpful, Do reward points.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Nov 2007 09:54:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/constructors/m-p/3060490#M724910</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-11-19T09:54:45Z</dc:date>
    </item>
    <item>
      <title>Re: Constructors</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/constructors/m-p/3060491#M724911</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;   Refer&lt;/P&gt;&lt;P&gt;&lt;A href="http://java.sun.com/docs/books/tutorial/java/TOC.html" target="test_blank"&gt;http://java.sun.com/docs/books/tutorial/java/TOC.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Assume that all the three classes have their own static and Instance constructors.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Case 1. When class A is instantiated.&lt;/P&gt;&lt;P&gt;First the Static constructor of A will be called, then the Instance Constructor.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Case 2. When class B is instantiated&lt;/P&gt;&lt;P&gt;First the Static constructor of the Class B will be called, then the Instance Constructor. One has to explicitly call the construcotrs of class A in the contructors of class B. If constructors of class A are not called (Constructor of Super class is called by SUPER-&amp;gt;Constructor in the sub-class constrcutor) in the sub class, then they are not executed. If they are called, then Static constructor of class A will be called first, then Instance Constructor.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Case 3. Whne Class C is instantiated.&lt;/P&gt;&lt;P&gt;Same as Case 2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Nov 2007 09:58:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/constructors/m-p/3060491#M724911</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-11-19T09:58:40Z</dc:date>
    </item>
    <item>
      <title>Re: Constructors</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/constructors/m-p/3060492#M724912</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;      The constructor is a special instance method in a class with the name constructor.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      Each class can have one constructor.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      The constructor is automatically called at runtime within the CREATE OBJECT statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      If you need to implement the constructor, then you must define and implement it in the PUBLIC SECTION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      You cannot normally call the constructor explicitly &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Static Constructor&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The static constructor is a special static method in a class with the name class_constructor. It is executed precisely once per program. &lt;/P&gt;&lt;P&gt;The static constructor of a class &amp;lt;classname&amp;gt; is called automatically when the class is first accessed, but before any of the following actions are executed: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Creating an instance in the class using CREATE OBJECT &amp;lt;obj&amp;gt;, where &amp;lt;obj&amp;gt; has the data type REF TO &amp;lt;classname&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Addressing a static attribute using &amp;lt;classname&amp;gt;=&amp;gt;&amp;lt;attribute&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Calling a static attribute using CALL METHOD &amp;lt;classname&amp;gt;=&amp;gt;&amp;lt;classmethod&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Registering a static event handler method using SET HANDLER &amp;lt;classname&amp;gt;=&amp;gt;&amp;lt;handler_method&amp;gt; FOR &amp;lt;obj&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Registering an event handler method for a static event in class &amp;lt;classname&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The static constructor cannot be called explicitly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      In the case of redefined methods, changing the interface (overloading) is not permitted; exception: Overloading is possible with the constructor. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Abstract classes are normally used as an incomplete blueprint for concrete (that is, non-abstract) subclasses, for example to define a uniform interface. &lt;/P&gt;&lt;P&gt;Classes with at least one abstract method are themselves abstract. &lt;/P&gt;&lt;P&gt;Static methods and constructors cannot be abstract.&lt;/P&gt;&lt;P&gt;You can specify the class of the instance to be created explicitly: CREATE OBJECT &amp;lt;RefToAbstractClass&amp;gt; TYPE &amp;lt;NonAbstractSubclassName&amp;gt;. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If it is to be impossible to instantiate a class more than once (for example, because it serves as a data administrator or data container), you can use the singleton concept. The class is defined with the addition CREATE PRIVATE and FINAL and instantiated using its static constructor. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Reward if usefull&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Nov 2007 10:59:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/constructors/m-p/3060492#M724912</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-11-19T10:59:03Z</dc:date>
    </item>
    <item>
      <title>Re: Constructors</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/constructors/m-p/3060493#M724913</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the prompt reply,it resolved my doubt.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Nov 2007 13:45:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/constructors/m-p/3060493#M724913</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-11-19T13:45:01Z</dc:date>
    </item>
  </channel>
</rss>

