后浪云鸿蒙OS教程:鸿蒙OS UncheckedIOException

树叶云

UncheckedIOException

java.lang.Object

|—java.lang.Throwable

|—|—java.lang.Exception

|—|—|—java.lang.RuntimeException

|—|—|—|—java.io.UncheckedIOException

public class UncheckedIOException
extends RuntimeException

用未经检查的异常包装 IOException。

Since:

1.8

构造函数摘要

构造函数描述
UncheckedIOException(IOException cause)构造此类的一个实例。
UncheckedIOException(String message, IOException cause)构造此类的一个实例。

方法总结

修饰符和类型方法描述
IOExceptiongetCause()返回此异常的原因。
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
从类 java.lang.Throwable 继承的方法
addSuppressed, fillInStackTrace, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString

构造函数详细信息

UncheckedIOException

public UncheckedIOException(String message, IOException cause)

构造此类的一个实例。

参数:

参数名称参数描述
message详细信息,可以为空
causeIO异常

Throws:

Throw名称Throw描述
NullPointerException如果 cause 为空

UncheckedIOException

public UncheckedIOException(IOException cause)

构造此类的一个实例。

参数:

参数名称参数描述
causeIO异常

Throws:

Throw名称Throw描述
NullPointerException如果 cause 为空

方法详情

getCause

public IOException getCause()

返回此异常的原因。

覆盖:

类 Throwable 中的 getCause

返回:

IOException 是导致此异常的原因。

文章来源网络,作者:运维,如若转载,请注明出处:https://shuyeidc.com/wp/185857.html<

(0)
运维的头像运维
上一篇2025-03-29 13:13
下一篇 2025-03-29 13:14

相关推荐

发表回复

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