13518219792

建站动态

根据您的个性需求进行定制 先人一步 抢占小程序红利时代

创新互联鸿蒙OS教程:鸿蒙OSFileNotFoundException

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 详细信息。

分享文章:创新互联鸿蒙OS教程:鸿蒙OSFileNotFoundException
当前链接:http://cdbrznjsb.com/article/cccjhge.html

其他资讯

让你的专属顾问为你服务