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)- A75% (39)
- B8% (4)
- C13% (7)
- D4% (2)
Explanation
Topics
#try-catch#finally block#try-with-resources#exception order
Community Discussion
No community discussion yet for this question.