SAP Certified Associate Back End Developer ABAP Cloud · Free Practice Question Hard

Question 19

Given this code,

With Icl_super being superclass for Icl_sub1 and Icl_sub2 and with methods sub1_meth1 and sub2_meth1 being subclass-specific methods of Ic_sub1 or Icl_sub2, respectively.

What will happen when executing these casts? (2 correct)

  • A

    go_sub1->sub1_meth 1(…). will work.

  • B

    go_sub1 = CAST #( go_super ), will not work

    go_sub2 = CAST #( go_super ), will work.

  • C

    go_sub2->sub2_meth 1(...). will work

  • D

    go_sub1 = CAST #( go_super ), will work

    go_sub2 = CAST #( go_super ). will not work.

Reveal correct answers

Correct answers: A, D

Discussion

Think the marked answer is wrong, or have a better explanation? Share it below — comments appear after review.

You must be logged in to post a comment.

Preparing For

Your Certification?

255+ certifications
Detailed explanations
Free PDF samples

Has All The Questions You Need