nerdexam
Oracle

1Z0-815 · Question #102

Which two statements are correct about try blocks? (Choose two.)

The correct answer is A. A try block can have more than one catch block. E. catch blocks must be ordered from generic to specific exception types. https://beginnersbook.com/2013/04/try-catch-in-java/

Handling Exceptions

Question

Which two statements are correct about try blocks? (Choose two.)

Options

  • AA try block can have more than one catch block.
  • BA finally block in a try-with-resources statement executes before the resources declared are
  • CA finally block must be immediately placed after the try or catch blocks.
  • DA try block must have a catch block and a finally block.
  • Ecatch blocks must be ordered from generic to specific exception types.

How the community answered

(52 responses)
  • A
    75% (39)
  • B
    8% (4)
  • C
    13% (7)
  • D
    4% (2)

Explanation

https://beginnersbook.com/2013/04/try-catch-in-java/

Topics

#try-catch#finally block#try-with-resources#exception order

Community Discussion

No community discussion yet for this question.

Full 1Z0-815 Practice