B: Two mutually exclusive exceptions. Will work fine.D: A single exception. Will work fine.E: Two mutually exclusive exceptions. Will work fine.Note: In Java SE 7 and later, a single catch block can handle more than one type of exception. This feature can reduce code duplication and lessen the temptation to catch an overly broad exception.In the catch clause, specify the types of exceptions that block can handle, and separate each exception type with a vertical bar (|).Note 2: NoSuchFileException: Checked exception thrown when an attempt is made to access a file that does not exist.InvalidPathException: Unchecked exception thrown when path string cannot be converted into a Path because the path string contains invalid characters, or the path string is invalid for other file system specific reasons.FileNotFoundException: Signals that an attempt to open the file denoted by a specified pathname has failed.This exception will be thrown by the FileInputStream, FileOutputStream, andRandomAccessFile constructors when a file with the specified pathname does not exist. It will also be thrown by these constructors if the file does exist but for some reason is inaccessible, for example when an attempt is made to open a read-only file for writing.
B: Two mutually exclusive exceptions. Will work fine.
D: A single exception. Will work fine.
E: Two mutually exclusive exceptions. Will work fine.
Note: In Java SE 7 and later, a single catch block can handle more than one type of exception. This feature can reduce code duplication and lessen the temptation to catch an overly broad exception.
In the catch clause, specify the types of exceptions that block can handle, and separate each exception type with a vertical bar (|).
Note 2: NoSuchFileException: Checked exception thrown when an attempt is made to access a file that does not exist.
InvalidPathException: Unchecked exception thrown when path string cannot be converted into a Path because the path string contains invalid characters, or the path string is invalid for other file system specific reasons.
FileNotFoundException: Signals that an attempt to open the file denoted by a specified pathname has failed.
This exception will be thrown by the FileInputStream, FileOutputStream, and
RandomAccessFile constructors when a file with the specified pathname does not exist. It will also be thrown by these constructors if the file does exist but for some reason is inaccessible, for example when an attempt is made to open a read-only file for writing.