Content deleted Content added
→Early exit: PEP-8 |
|||
Line 131:
The [[Java (programming language)|Java]] language introduced a new syntax called <code>try</code>-with-resources in Java version 7.<ref>Oracle Java tutorial: [http://docs.oracle.com/javase/tutorial/essential/exceptions/tryResourceClose.html The try-with-resources Statement]</ref> It can be used on objects that implement the AutoCloseable interface (that defines method close()):
<source lang="java">
try (
//
} catch (IOException ex) {
//
// The resource x is automatically closed
|