Exam C-ABAPD-2507 Topic 3 Question 12 Discussion

Actual exam question for SAP's C-ABAPD-2507 exam
Question #: 12
Topic #: 3
Given this code,
INTERFACE if1.
METHODS m1.
ENDINTERFACE.
CLASS cl1 DEFINITION.
PUBLIC SECTION.
INTERFACES if1.
METHODS m2.
ENDCLASS.
" in a method of another class
DATA go_if1 TYPE REF TO if1.
DATA go_cl1 TYPE REF TO cl1.
go_cl1 = NEW #( ... ).
go_if1 = go_cl1.
What are valid statements? (Select 3 correct answers)

Suggested Answer: A,D,E Vote an answer

Comprehensive and Detailed Explanation From Exact Extract:
* An interface reference (go_if1) can point to any object of a class that implements that interface.
Therefore, creating an instance with NEW cl1( ... ) and directly assigning it to the interface-typed variable is valid (A).
* Type inference with NEW #( ... ) cannot infer a class from an interface-typed target (no unique implementing class), so (B) is invalid.
* An interface reference exposes only the interface's methods; it cannot call class-specific methods (so (C) is invalid).
* Calling interface method m1 via the interface reference is valid (D).
* From the class reference, the interface method can be called (implicitly or explicitly qualified) as go_cl1->if1~m1( ... ) (E).
This reflects ABAP OO rules in ABAP Cloud (method visibility via static type, interface implementation, and explicit interface method calls).
Study Guide Reference: ABAP Objects-Interfaces & Class Constructors; ABAP Cloud Back-End Developer-OO fundamentals.

by Priscilla at Oct 15, 2025, 08:47 AM

Comments

Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
Nick name: Submit Cancel
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

0
0
0
10