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

OutOfMemoryError

java.lang.Object

|—java.lang.Throwable

|—|—java.lang.Error

|—|—|—java.lang.VirtualMachineError

|—|—|—|—java.lang.OutOfMemoryError

public class OutOfMemoryError
extends VirtualMachineError

当 Java 虚拟机因为内存不足而无法分配对象时抛出,并且垃圾收集器无法提供更多内存。 OutOfMemoryError 对象可以由虚拟机构造,就像 Throwable#Throwable(String, Throwable, boolean, boolean)。

构造函数摘要

构造函数 描述
OutOfMemoryError() 构造一个没有详细消息的 OutOfMemoryError。
OutOfMemoryError(String s) 构造带有指定详细消息的 OutOfMemoryError。

方法总结

从类 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

构造函数详细信息

OutOfMemoryError

public OutOfMemoryError()

构造一个没有详细消息的 OutOfMemoryError。

OutOfMemoryError

public OutOfMemoryError(String s)

构造带有指定详细消息的 OutOfMemoryError。

参数:

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

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

(0)
晴川运维晴川运维
上一篇 2025年6月13日
下一篇 2025年6月13日

相关推荐

发表回复

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