Single Choice Moderate

Q

You are working on a project that involves the development of a new class in X++ for Microsoft Dynamics 365 finance and operations apps.

You need to create a subclass that extends an existing superclass and overrides one of its methods to customize its behavior.

What three steps should you perform? Each correct answer presents part of the solution. Choose three.

ID: #22528 Exam MB-500: Microsoft Dynamics 365: Finance and Operations Apps Developer 130 views
Question Info
#22528Q ID
ModerateDifficulty
Exam MB-500: Microsoft Dynamics 365: Finance and Operations Apps DeveloperTopic

Choose the Best Option

Click any option to instantly check if you're correct.

  • A Create a new class and use the 'extends' keyword to specify the superclass it should inherit from. ✔ ✖
  • B Add the desired functionality to the overridden method in the subclass. ✔ ✖
  • C In the subclass, declare a method with the same name and parameters as the method in the superclass. ✔ ✖
  • D A, B, C ✔ ✖
Correct Answer

Explanation

Wrong: Use the 'final' keyword when declaring the subclass to prevent further inheritance.

Wrong: Declare the method to be overridden in the subclass as 'private'.

Wrong: Use the 'overload' keyword to change the functionality of the inherited method.


To create a subclass that extends a superclass, you need to create a new class and use the 'extends' keyword to specify the superclass it should inherit from. To override a method from the superclass, you need to declare a method with the same name and parameters in the subclass and add the desired functionality. Using the 'final' keyword when declaring the subclass would prevent further inheritance, which is not required in this scenario. Declaring the method to be overridden as 'private' would make it inaccessible from the subclass. The 'overload' keyword does not exist in X++, so it cannot be used to change the functionality of the inherited method.

X++ inheritance - Finance & Operations | Dynamics 365 | Microsoft Learn

Add code and methods to meet business requirements - Training | Microsoft Learn

Today: 0 answered · 0 correct
Save progress
Free account

Want to remember what you got wrong?

Create a free account in seconds to track your score, revisit mistakes and continue X++ Programming Language where you left off.

  • Save your progress & streak
  • Topic-wise quizzes & scores
  • Bookmark tricky questions
  • Printable MCQ sets
Practice smarterFree account · save progress
Sign up free

Share This Question

Challenge a friend or share with your study group.

Related MCQ Questions