Skip to Content
author's profile photo Former Member
Former Member

Regarding static methos and attributes...

Hi..

What do u mena by static methids and atributes?

Why v'll use these?

Whats the purpose?

Regards

sandeep.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jan 29, 2008 at 05:56 AM

    Hi,

    The methods are internal procedures that define the behavior of an object in a class. They can access all the attributes of a class.

    Exam: METHOD <Meth1>

    ENDMETHOD

    Here Meth1 is method name.

    You call the methods by using the CALL METHOD statement.

    There are two types of methods.

    1. Istance Method

    2. Static Method.

    You can declare instance methods by using the METHODS statement.

    You can declare static methods by using the CLASS-METHODS statement.

    Static Method can only access static attributes and trigger static events.

    Static methods cannot be redefined. Redefining a method means creating a new implementation of the method in a subclass without changing the interface.

    --Ranveer

    ranveerpsingh@gmail.com

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 29, 2008 at 05:44 AM

    Hi,

    Static Attributes

    The contents of static attributes define the state of the class that is valid for all instances of the class. Static attributes exist once for each class. You declare them using the CLASS-DATA statement. They are accessible for the entire runtime of the class.

    All of the objects in a class can access its static attributes. If you change a static attribute in an object, the change is visible in all other objects in the class.

    The technical properties of instance attributes belong to the static properties of a class. It is therefore possible to refer in a LIKE addition to the visible attributes of a class – through the class component selector or through reference variables, without prior creation of an object.

    Methods

    Methods are internal procedures in a class that define the behavior of an object. They can access all of the attributes of a class. This allows them to change the data content of an object. They also have a parameter interface, with which users can supply them with values when calling them, and receive values back from them The private attributes of a class can only be changed by methods in the same class.

    The definition and parameter interface of a method is similar to that of function modules. You define a method meth in the definition part of a class and implement it in the implementation part using the following processing block:

    Static Methods

    You declare static methods using the CLASS-METHODSstatement. They can only access static attributes and trigger static events.

    Reward If Helpfull.

    Regards Madhu.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.