It’s time to put what you’ve learned to the test, get 7 questions right to pass this unit.
Q1.
Which of the following signature elements may an instance constructor have?
There are two correct answers.
A
Importing parameters
B
Exporting parameters
C
Changing parameters
D
Exceptions
Q2.
A class class contains the public static method method. What is the correct code to call this method?
Choose the correct answer.
A
class=>method( ).
B
class->method( ).
C
class=>method().
D
class->method().
Q3.
The static constructor is executed when the class is addressed for the first time. When might this be?
There are two correct answers.
A
At the beginning of the program.
B
When you call a static method of the class.
C
When you instantiate the class.
Q4.
A functional method must have
Choose the correct answer.
A
Exactly one importing parameter
B
Exactly one exporting parameter
C
No changing parameters
D
Exactly one returning parameter
Q5.
In which order do you define the visibility sections of a class?
Choose the correct answer.
A
It doesn't matter.
B
PRIVATE SECTION. PROTECTED SECTION. PUBLIC SECTION.
C
PUBLIC SECTION. PROTECTED SECTION. PRIVATE SECTION.
Q6.
You have declared two reference variables, ref1 and ref2. ref1 points to an object. You now execute the statement ref2 = ref1. What happens?
Choose the correct answer.
A
The ABAP system creates a copy of the object to which ref1 is pointing and assigns its address to ref2. There are now two objects.
B
The ABAP system assigns the address of the object to which ref1is pointing to reference variable ref2. There is only one object.
Q7.
Your class contains a public instance attribute attr. How could you ensure that its value can only be changed within the class?
There are two correct answers.
A
Move it to a different local class.
B
Leave it in the public section but use the <code>READ-ONLY</code> addition.
C
Convert it into a constant.
D
Make it a private attribute.
Q8.
You have defined a class containing instance attributes and static attributes. You have also declared a reference variable but not yet created a new instance of the class. Which components of the class can you access at this point, and how?
Choose the correct answer.
A
Static components using the name of the class.
B
Static components using the reference variable.
C
Instance components using the name of the class.
D
Instance components using the reference variable.
To complete the knowledge quiz you need to create an account or login