Static Attributes

Which of the following statements are true? Select all that apply.

A. Static attributes can be declared only in the private visibility section of the class.
B. Static attributes are declared with the CLASS-DATA statement.
C. A static attribute is the same across all instances of the class. There is only one static attribute across all instances of the class.
D. Static attributes cannot be changed by an object.

Which is the correct answer?

---

Answers / Explanation

Static attributes can be defined in the private and public visibility sections of the class.

Static attributes are defined with the CLASS-DATA statement in the definition part of the class.

Static attributes exist once per class and are the same for all of the runtime instances of the class.

If you change the static attribute of the class, this change will apply for all of the instances of the class.

Static attributes can be changed by an instance of the class.

All of the objects of the class can access the static attribute of the class.

Correct answers: B, C
 

ABAP Tips

 

See Also
Unicode Checks

Get help for your ABAP problems
Do you have a ABAP Question?

ABAP Books
ABAP Certification, BAPI, Java, Web Programming, Smart Forms, Sapscripts Reference Books

More ABAP Tips

Main Index
SAP Basis, ABAP Programming and Other IMG Stuff

All the site contents are Copyright © www.erpgreat.com and the content authors. All rights reserved.
All product names are trademarks of their respective companies.  The site www.erpgreat.com is in no way affiliated with SAP AG. 
Every effort is made to ensure the content integrity.  Information used on this site is at your own risk. 
 The content on this site may not be reproduced or redistributed without the express written permission of 
www.erpgreat.com or the content authors.