次のようにカスタム例外クラスを作成しました
public class CustomException extends Exception{
// some code here
}
今、私は次のようなコードを持っています
File file = new File("some_file_path");
try {
FileOutputStream outputStream = new FileOutputStream(file);
} catch (CustomException e) {
e.printStackTrace();
}
しかし、コンパイラはUnhandled exception type FileNotFoundExceptionエラーを表示します
私の要点は、コンパイラは、私が CustomException を介して FileNotFoundException をキャッチしていることを理解していないということですか?
助けてください。