ECCouncil Certified Application Security Engineer (CASE) JAVA 312-96 Question # 9 Topic 1 Discussion

ECCouncil Certified Application Security Engineer (CASE) JAVA 312-96 Question # 9 Topic 1 Discussion

312-96 Exam Topic 1 Question 9 Discussion:
Question #: 9
Topic #: 1

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


B.

Try-Catch block


C.

Try-With-Resources block


D.

Try-Catch-Resources block


Get Premium 312-96 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.