Oracle Java SE 8 Programmer II 1z0-809 Question # 14 Topic 2 Discussion

Oracle Java SE 8 Programmer II 1z0-809 Question # 14 Topic 2 Discussion

1z0-809 Exam Topic 2 Question 14 Discussion:
Question #: 14
Topic #: 2

Given the code fragments:

4. void doStuff() throws ArithmeticException, NumberFormatException, Exception {

5. if (Math.random() >-1 throw new Exception (“Try again”);

6. }

and

24. try {

25. doStuff ( ):

26. } catch (ArithmeticException | NumberFormatException | Exception e) {

27. System.out.println (e.getMessage()); }

28. catch (Exception e) {

29. System.out.println (e.getMessage()); }

30. }

Which modification enables the code to print Try again?


A.

Comment the lines 28, 29 and 30.


B.

Replace line 26 with:} catch (Exception | ArithmeticException | NumberFormatException e) {


C.

Replace line 26 with:} catch (ArithmeticException | NumberFormatException e) {


D.

Replace line 27 with:throw e;


Get Premium 1z0-809 Questions

Contribute your Thoughts:


Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.