有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!


共 (2) 个答案

  1. # 1 楼答案

    FileNotFoundException不一定表示文件不存在。例如,如果传入的名称表示目录而不是文件,jvm将无法写入相应的句柄,并将通过异常报告相同的句柄

    根据java文档

    Throws: FileNotFoundException - If the given file object does not denote an existing, writable regular file and a new regular file of that name cannot be created, or if some other error occurs while opening or creating the file