(Choose 1 answer)
Here is part of the hierarchy of exceptions that may be thrown during file IO operations:
Exception +-- IOException +-- FileNotFoundException
Suppose you had a method X that is supposed to open a file by name and read data from it.inside X may throw a FileNotFoundException or other exceptions descended from IOExcept does not have any try-catch statements, which of the following options are true?
A. The method X must be declared as throwing IOException or Exception.
B. The method X must be declared as throwing FileNotFoundException.
C. Any method that calls X must use try-catch, specifically catching FileNotFoundException
D. No special precautions need to be taken.
7