Given:
What is the result?
Given:
What is the result?
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'.
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.
There will be a compilation error- B
A is the correct answer