src/share/classes/java/lang/AutoCloseable.java

Print this page

        

*** 32,43 **** * @since 1.7 */ public interface AutoCloseable { /** * Close this resource, relinquishing any underlying resources. ! * This method is invoked automatically by the automatic resource ! * management block construct. * * <p>Classes implementing this method are strongly encouraged to * be declared to throw more specific exceptions (or no exception * at all, if the close cannot fail). * --- 32,43 ---- * @since 1.7 */ public interface AutoCloseable { /** * Close this resource, relinquishing any underlying resources. ! * This method is invoked automatically by the {@code ! * try}-with-resources statement. * * <p>Classes implementing this method are strongly encouraged to * be declared to throw more specific exceptions (or no exception * at all, if the close cannot fail). *