Question 69 of 103 from exam MB-500: Microsoft Dynamics 365: Finance and Operations Apps Developer

Question 69 of 103 from exam MB-500: Microsoft Dynamics 365: Finance and Operations Apps Developer

Question

HOTSPOT - You are a Dynamics 365 Finance developer.

You have the following code: (Line numbers are included for reference only.)

01 public void tryMethod(int a, int b)
02 {

030 «try

04

05 info("One”) ;
06 int ¢ = a/b;
07 info("Two”) ;
os}

09° catch

10

1 info (“Three”) ;
12 if (a == 2);
13 {

14 return;

15 }

16 else if (a == 3)
17 {

18 b= 3;

19 retry;

20 }

21}

22. finally

230

24 info(‘Four”) ;
25}

26 info(“Five”);
27 3

You need to evaluate the code.

What is the correct output for the method? To answer, select the appropriate option in the answer area.

NOTE: Each correct selection is worth one point.

Hot Area:

Answer Area

Method Output

tryMethod(5,2)5 v

One, Two, Four, Five
One, Two, Five
One, Three, Four, Five

tryMethod (4,0); v

One, Three, Four, Five
One, Four, Five
One, Two, Four, Five

tryMethod (2,0); v

One, Three, Four
One, Three
One, Three, Four, Five

tryMethod (3,0); v

One, Two, Four, Five
One, Three, One, Two, Four, Five
One, Three, Four, One, Two, Four, Five

Explanations

Answer Area

Method Output

tryMethod(5,2)5 v

One, Two, Four, Five
One, Two, Five
One, Three, Four, Five

tryMethod (4,0); v

One, Three, Four, Five
One, Four, Five
One, Two, Four, Five

tryMethod (2,0); v

One, Three, Four
One, Three
One, Three, Four, Five

tryMethod (3,0); v

One, Two, Four, Five
One, Three, One, Two, Four, Five
One, Three, Four, One, Two, Four, Five

Box 1: One, Two, Four, Fire - The statements in the finally clause are executed when control leaves the try block, either normally or through an exception.

Box 2: One, Three, Four, Five - Box 3: One, Three - Return ends the call.

Box 4: One, Three, One, Two, Four, Five Retry restarts the try statement.

https://docs.microsoft.com/en-us/dynamics365/fin-ops-core/dev-itpro/dev-ref/xpp-exceptions