MCQ Practice Single Best Answer Topic: Explore extensions and the extension framework in finance and operations apps

Q You create a new class by using a method. You need to protect the method from being extended by using Chain of Command (CoC). Which attribute or modifiers should you use to protect the method?

Question ID
#24587
Subchapter
Explore extensions and the extension framework in finance and operations apps
Action
Choose one option below

Choose Your Answer

Click an option to check whether your answer is correct.

  • A Use [Hookable(false)] as a method attribute.
  • B Use [Wrappable(false)] as a method attribute.
  • C Use [Replaceable(true)] as a method attribute.
  • D Use a protected modifier.
Correct Answer: B

Explanation

❌Incorrect. You can use ´[Hookable(false)] to block pre-events and post-events, but it doesn’t block extensions that are made by CoC. To prevent extensions that are made by CoC, use the ´[Wrappable(false)] attribute or the private modifier for the method.

✔️ Correct. ´[Wrappable(false)] generates a compiler error if CoC is your method. In this case, the project isn’t built because a compiler error exists.

✔️ Incorrect. ´[Replaceable(true)] allows you to overwrite the existing method and doesn’t generate a compiler error during build.

Share This Question

Share this MCQ with your friends or study group.