1/27
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai |
|---|
No analytics yet
Send a link to your students to track their progress
What is the purpose of the NEW operator in ABAP?
The NEW operator is used to dynamically create a new instance of a class in program memory.
What must you use to access instance attributes outside the class in ABAP?
You must use a reference variable followed by the instance component selector (->) and then the attribute name.
How do you declare a reference variable in ABAP?
You declare a reference variable using the DATA statement with the addition TYPE REF TO followed by the name of the class.
What does the term 'NULL reference' mean?
The initial state of a reference variable indicating it does not currently point to any object in memory.
What is an internal table in ABAP?
A dynamic data structure that can store multiple lines of data, often used to manage collections of records or object references.
What happens when you assign one reference variable to another?
The address of the object to which the first variable is pointing is copied into the second reference variable, making both reference the same object.
What is the function of the garbage collector in ABAP?
The garbage collector automatically reclaims memory by destroying objects to which no active reference variables point.
What is the difference between a static attribute and an instance attribute?
A static attribute belongs to the class itself and exists once for the entire class, while an instance attribute belongs to a specific instance of a class.
How do you address a static attribute outside a class?
By typing the class name, then the static component selector (=>), and finally the attribute name.
How is an object reference stored in an internal table?
An object reference is appended to the internal table, maintaining the reference to the created object.
What is indicated by the pound sign #( ) after the NEW operator?
It means to use the type of the variable before the equals sign, allowing for concise instantiation of a class.
What does the APPEND statement do in ABAP?
The APPEND statement is used to add an item to the end of an internal table.
How do you create multiple instances of a class using the same reference variable?
By using the NEW #( ) expression each time, which overwrites the previous instance address in the reference variable.
What syntax is used to access instance attributes after using a reference variable?
Use the instance component selector (->) followed by the instance attribute name.
What will happen if the last reference to an object is deleted?
The object becomes eligible for garbage collection and will be destroyed by the garbage collector.
What character is used as the instance component selector in ABAP?
The instance component selector is represented by an arrow (->) made of a dash and a greater-than sign.
What keyboard shortcut is used to activate a class in the ABAP editor?
Ctrl + F3 is used to activate a class in the ABAP editor.
What type of variable structure is used to hold object references for managing multiple instances?
An internal table is used to hold object references for managing multiple instances.
In ABAP, what does the DATA statement do?
The DATA statement is used to declare variables, including reference variables for classes.
What does the CLEAR statement do for reference variables?
The CLEAR statement resets reference variables to their initial value, which is NULL.
What is the significance of using different characters for static and instance component selectors in ABAP?
It simplifies distinguishing between accessing class-level data and instance-specific data.
How can you debug a program in Eclipse ADT?
You can use breakpoints to pause execution and examine variable values at specific points.
What purpose does the Pattern Matching (.matches) keyword serve in ABAP?
It allows checking patterns in strings and evaluating if a string meets specific conditions.
What tool allows you to visualize the state of variables during program execution?
The Variables View in the Eclipse ADT debugger displays the current values of variables.
What action should be taken to check if an object reference is still valid before using it?
Check if the reference variable is not NULL before using it to prevent errors.
What is a reference variable primarily used for in ABAP object-oriented programming?
A reference variable is used to create, address, and manage an object within memory.
Explain how the Eclipse toolbar enhances developer productivity in ABAP programming.
The Eclipse toolbar provides quick access to navigation and development functionalities, improving coding efficiency.
When is the class definition loaded into program memory?
The class definition is loaded when it is first accessed, such as when creating an instance.