Q: 11
Refer to the exhibit.
with which predicate condition can you ensure that the CAST will work?
with which predicate condition can you ensure that the CAST will work?Options
Discussion
C is what I'd pick here. You want to make sure the object actually matches the class before you CAST, otherwise ABAP will throw a runtime error. That's exactly what IS INSTANCE OF checks for. Official SAP guide and a good practice test both cover this scenario. If someone has a different take, let me know.
For this kind of CAST you need to check type compatibility, so C (IS INSTANCE OF) fits. Saw a similar question in a practice exam, IS INSTANCE OF is the usual way to avoid cast errors. Makes sense?
Be respectful. No spam.