TAW_12 Chapter 2, Fundamental OO syntax Flashcards
What are the two ways to define exceptions in a method definition?
EXCEPTIONS
Exception NO_BOB “would set sy-subrc to 1
or
RAISING exception_class
Old school functional methods had only returning and importing params
They now have exporting and changing
In a class is it possible for an instance attribute to share a name with an instance method?
No, but a method can reuse an instance attribute
In UML what is the prefix for public, private, and static attributes
\+ = public - = private _ = Static
DATA: obj1 type ref to cl_bob,
obj2 like obj1
Is the above valid?
Yes
DATA lcl_bob type ref to cl_name,
lcl_jim like lcl_bob
LCL_JIM = LCL_BOB
creates how many objects of type name?
Only one object exists and both lcl_bob and lcl_jim point to it
Functional methods can be called in what expressions
Move, Case, Loop
If, While, Check, Wait until
Compute (this covers all math basically)
An instance constructor can have what in it’s signature
Importing and Exceptions
A class-constructor can have what in its signature
Basically nothing
If I access a static attribute, is the class constructor called?
Yes!
self reference is
me->
me-> refers to…?
The instance/object reference. In the case where a instance attribute and local method attribute share the same name, me-> will point to the instance level component