ExamGecko
Question list
Search
Search

List of questions

Search

Related questions











Question 40 - 312-96 discussion

Report
Export

James is a Java developer working INFR INC. He has written Java code to open a file, read it line by line and display its content in the text editor. He wants to ensure that any unhandled exception raised by the code should automatically close the opened file stream. Which of the following exception handling block should he use for the above purpose?

A.
Try-Catch-Finally block
Answers
A.
Try-Catch-Finally block
B.
Try-Catch block
Answers
B.
Try-Catch block
C.
Try-With-Resources block
Answers
C.
Try-With-Resources block
D.
Try-Catch-Resources block
Answers
D.
Try-Catch-Resources block
Suggested answer: C
asked 18/09/2024
Arkadius Thoma
46 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first