gpt4 book ai didi

java - 我需要一位专家让我了解 Java Throwable 的 addSuppressed 的作用?

转载 作者:塔克拉玛干 更新时间:2023-11-03 05:33:18 36 4
gpt4 key购买 nike

<分区>

Possible Duplicate:
JDK 1.7 Throwable `addSuppressed()` method

所以Java在Throwable中有一个方法

public final void addSuppressed(Throwable exception) 

这就是它的作用:

Appends the specified exception to the exceptions that were suppressed in order to deliver this exception. This method is thread-safe and typically called (automatically and implicitly) by the try-with-resources statement.

..我对此感到困惑,什么是“被抑制的异常的指定异常”为了提供这个异常(exception)。”?

36 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com