AutoCloseable简单用法
解决方法:
假如现在RPCClient 类中有一个属性connection,使用完后要关闭处理,实现AutoCloseable 接口,重写其中的 close()方法,在close方法中关闭你想关闭的资源。
AutoCloseable简单用法
解决方法:
假如现在RPCClient 类中有一个属性connection,使用完后要关闭处理,实现AutoCloseable 接口,重写其中的 close()方法,在close方法中关闭你想关闭的资源。