"I never think of the future. It comes soon enough."
- Albert Einstein
throw new FileNotFoundException();
System.out.print(" Catch Here "); /* Line 7 */
System.out.print("End of file exception");
System.out.print("File not found");
and given that EOFException and FileNotFoundException are both subclasses of IOException, and further assuming this block of code is placed into a class, which statement is most true concerning this code?
The code will not compile.
Code output: Start Hello world File Not Found.
Code output: Start Hello world End of file exception.
Code output: Start Hello world Catch Here File not found.
Answer: Option D
Line 7 will cause a compiler error. The only legal statements after try blocks are either catch or finally statements.
Option B, C, and D are incorrect based on the program logic described above. If line 7 was removed, the code would compile and the correct answer would be Option B.