safeWithoutException(()->{real method.}); void safeWithoutException(ExecuteWithoutException ob){ try { ob.doMethod(); } catch (Exception | AssertionError e) { logger.logInfo("It throws exception in finally block."); e.printStackTrace(); } } public interface ExecuteWithoutException{ void doMethod() throws Exception; }
Java 8 lambula finally
最新推荐文章于 2023-12-28 16:16:04 发布