jason19659
V2EX  ›  问与答

Java 如何写未调用方法警告?

  •  
  •   jason19659 · Dec 1, 2017 · 1798 views
    This topic created in 3082 days ago, the information mentioned may be changed or developed.

    在我们使用流并且未关闭的时候,IDE 会显示未关闭警告,“ Resource leak: 'sc' is never closed ”。当调用 close();方法后,警告消除。

    请问这种效果是如何实现的。

    未调用某方法显示警告,调用后警告消失.

    https://www.zhihu.com/question/263436188

    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2713 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 15:57 · PVG 23:57 · LAX 08:57 · JFK 11:57
    ♥ Do have faith in what you're doing.