Skip to Content

MB-500: What Is the Best Approach to Enable Method Overriding in Dynamics 365 Applications?

Table of Contents

Question

You are developing a Microsoft Dynamics 365 application. The application includes a ‘Vehicle’ class and several derived classes such as ‘Car’, ‘Bus’, and ‘Truck’.

You need to ensure that certain methods in the ‘Vehicle’ class can be overridden in the derived classes.

What should you do? Each correct answer presents part of the solution. Choose two.

Select all answers that apply.

A. Declare the methods in the ‘Vehicle’ class as sealed.
B. Declare the methods in the ‘Vehicle’ class as final.
C. Declare the methods in the ‘Vehicle’ class as virtual.
D. Declare the methods in the ‘Vehicle’ class as overridable.
E. Declare the methods in the ‘Vehicle’ class as static.

Answer

C. Declare the methods in the ‘Vehicle’ class as virtual.
D. Declare the methods in the ‘Vehicle’ class as overridable.

Explanation

Options C and D are correct because declaring a method as virtual or overridable allows it to be overridden in a derived class. Option A is incorrect because declaring a method as sealed prevents it from being overridden. Option E is incorrect because static methods belong to the class itself, not an instance of the class, and cannot be overridden. Option B is incorrect because final methods cannot be overridden in a derived class.

Microsoft Dynamics 365: Finance and Operations Apps Developer MB-500 certification exam practice question and answer (Q&A) dump with detail explanation and reference available free, helpful to pass the Microsoft Dynamics 365: Finance and Operations Apps Developer MB-500 exam and earn Microsoft Dynamics 365: Finance and Operations Apps Developer MB-500 certification.