Exam 1z0-819 All QuestionsBrowse all questions from this exam
Question 14

Given:

What is the result?

    Correct Answer: C

    The correct execution flow is as follows: The method doA() is called, printing 'a'. Since the if condition in doA() is false, no exception is thrown. The method doB() is then called, printing 'b'. This method throws a FileNotFoundException which is caught by the catch block in the main method. In the catch block, 'c' is printed and the method returns. However, before the method actually returns, the finally block is executed, printing 'd'. Therefore, the output is 'adf'.

Discussion
Ankit1010Option: A

A is the correct answer. Since IndexOutOfBoundsException is a Runtime exception, there will be no Compilation Error. FileNotFoundException (Child of IOException) is a compile Time Exception, and it is already handled, so no compile time error.

Bravo6633Option: B

There will be a compilation error- B

StavokOption: A

A is the correct answer