晴川云鸿蒙OS教程:鸿蒙OS FileNotFoundException

FileNotFoundException

java.lang.Object

|—java.lang.Throwable

|—|—java.lang.Exception

|—|—|—java.io.IOException

|—|—|—|—java.io.FileNotFoundException

public class FileNotFoundException
extends IOException

表示尝试打开由指定路径名表示的文件失败的信号。

当具有指定路径名的文件不存在时,FileInputStream、FileOutputStream 和 RandomAccessFile 构造函数将引发此异常。 如果文件确实存在但由于某种原因不可访问,例如当试图打开只读文件进行写入时,这些构造函数也会抛出它。

Since:

JDK1.0

构造函数摘要

构造函数 描述
FileNotFoundException() 构造一个以 null 作为其错误详细消息的 FileNotFoundException。
FileNotFoundException(String s) 使用指定的详细消息构造 FileNotFoundException。

方法总结

从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
从类 java.lang.Throwable 继承的方法
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString

构造函数详细信息

FileNotFoundException

public FileNotFoundException()

构造一个以 null 作为其错误详细消息的 FileNotFoundException。

FileNotFoundException

public FileNotFoundException(String s)

使用指定的详细消息构造 FileNotFoundException。 字符串 s 可以稍后通过 java.lang.Throwable 类的 Throwable.getMessage() 方法检索。

参数:

参数名称 参数描述
s 详细信息。

原创文章,作者:晴川运维,如若转载,请注明出处:https://baike.qcidc.com/9623.html

(0)
晴川运维晴川运维
上一篇 3天前
下一篇 3天前

相关推荐

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注