| Server IP : 104.21.21.239 / Your IP : 216.73.217.71 Web Server : Apache/2.4.68 (Amazon Linux) OpenSSL/3.5.5 System : Linux ip-172-31-69-123.ec2.internal 6.1.176-223.369.amzn2023.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Jul 24 13:34:27 UTC 2026 x86_64 User : ec2-user ( 1000) PHP Version : 8.4.23 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /lib/jvm/java-1.8.0/sample/try-with-resources/ |
Upload File : |
<!DOCTYPE html>
<html>
<head>
<title>Try-with-Resources Feature Demo</title>
</head>
<body>
<h2>Try-with-Resources Feature Demo</h2>
<p>
This demo shows how to use the try-with-resources feature introduced in JDK7.
</p>
<ul>
<li><h3>Custom AutoCloseable.</h3>
<p>
Shows how to use a custom resource with the try-with-resources construct.
For more information, see the source file.
</p>
Source: <a href="src/CustomAutoCloseableSample.java">src/CustomAutoCloseableSample.java</a>
<li><h3>Unzip</h3>
<p>
Extracts archived files. For more information, see the source file.
</p>
Source: <a href="src/Unzip.java">src/Unzip.java</a>
<li><h3>ZipCat</h3>
<p>Prints data about a specified file from an archive. For more information, see the source file.</p>
Source: <a href="src/ZipCat.java">src/ZipCat.java</a>
</ul>
</body>
</html>