Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
The CREATE addition specifies the context in which the class is instantiated - that is, where the
statementCREATE OBJECT can be executed for this class. A class with the CREATE PUBLIC
addition can be instantiated anywhere that the class is visible. A class with the CREATE
PROTECTED addition can only be instantiated in methods of the class itself and its subclasses.
A class with the CREATE PRIVATE addition can only be instantiated in methods of the class
itself. This means, in particular, that it cannot be instantiated as an inherited component of
subclasses.
Where a class can be instantiated depends on its immediate superclass:
Immediate subclasses of classes with the CREATE PRIVATE addition that are not friends of
the class implicitly receive the CREATE NONE addition. They cannot be instantiated and you
cannot specify any explicit CREATE additions for them.
Immediate subclasses that are friends of the class implicitly inherit the CREATE PRIVATE
addition. All CREATE additions can be specified for all superclasses that can instantiated as
private using friends.
The statement METHODS constructor for the declaration of the instance constructor of a class
declared with the adition CREATE PRIVATE , can not only be listed in the public , but also in
the protected or private visible area . This allows the use of components, which have been
declared there, in the interface of the constructor.
CLASS cls_name DEFINITION CREATE PRIVATE.
...
ENDCLASS.
*&---------------------------------------------------------------------*
*& Report ZOOCL_PRIVATE03
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*
REPORT
*----------------------------------------------------------------------*
*
INTERFACE I1
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
INTERFACE i1.
DATA: l_at TYPE i.
ENDINTERFACE.
"I1