1z0-809 Exam Question 166
Given the code fragments:
4 . void doStuff() throws ArithmeticException, NumberFormatException, Exception
{
5 . if (Math.random() >-1 throw new Exception ("Try again");
6 . }
and
2 4. try {
2 5. doStuff ( ):
2 6. } catch (ArithmeticException | NumberFormatException | Exception e) {
2 7. System.out.println (e.getMessage()); }
2 8. catch (Exception e) {
2 9. System.out.println (e.getMessage()); }
3 0. }
Which modification enables the code to print Try again?
4 . void doStuff() throws ArithmeticException, NumberFormatException, Exception
{
5 . if (Math.random() >-1 throw new Exception ("Try again");
6 . }
and
2 4. try {
2 5. doStuff ( ):
2 6. } catch (ArithmeticException | NumberFormatException | Exception e) {
2 7. System.out.println (e.getMessage()); }
2 8. catch (Exception e) {
2 9. System.out.println (e.getMessage()); }
3 0. }
Which modification enables the code to print Try again?
1z0-809 Exam Question 167
Given the code fragment:

Which code fragment, when inserted at line 7, enables printing 100?

Which code fragment, when inserted at line 7, enables printing 100?
1z0-809 Exam Question 168
Given the code fragments :

and

What is the result?

and

What is the result?