I understand
Code: Select all
IOException|RuntimeException
Code: Select all
FileNotFoundException|IOException
Moderator: admin
Code: Select all
IOException|RuntimeException
Code: Select all
FileNotFoundException|IOException
Note that most commonly used methods in Java API that deal with reading or writing files have java.io.IOException in their throws clause. So you must handle this exception. At run time, more specific exceptions such as FileNotFoundException are actually thrown depending on the actual cause of the problem.
I think the another way to explain would be:The reason why the following answer is incorrect isn't really explained:
FileNotFoundException|SecurityException|IllegalArgumentException
I think it's because one or more of the exceptions is not thrown by the code in the try block, but I'm not sure.
Users browsing this forum: Bing [Bot] and 18 guests