最初のものは私には非常に謎めいた/複雑に見える本からのものです.2番目のものは私を含む私の周りの人々が書いているのを見た方法です:)、また最初のスタイルの日食はcatch "IOException openx"ブロックが読み取りと書き込みが行われている部分の例外を処理する
while ((len = is.read(buf)) >= 0)
out.write(buf, 0, len);
.catch "IOException iox" は役に立たないコードということですか?
最初のスタイル。
File file = new File("hsjdhsaj");
        InputStream is = null;
        try {
            URL url = new URL("");
            is = url.openStream();
            OutputStream out = new FileOutputStream(file);
            try {
                byte[] buf = new byte[4096];
                int len;
                while ((len = is.read(buf)) >= 0)
                    out.write(buf, 0, len);
            } catch (IOException iox) {
            } finally {
                try {
                    out.close();
                } catch (IOException closeOutx) {
                }
            }
        } catch (FileNotFoundException fnfx) {
        } catch (IOException openx) {
        } finally {
            try {
                if (is != null)
                    is.close();
            } catch (IOException closeInx) {
            }
        }
セカンドスタイル。
    File file = new File("hsjdhsaj");
        InputStream is = null;
        OutputStream out = null;
        try {
            URL url = new URL("");
            is = url.openStream();
            out = new FileOutputStream(file);
            byte[] buf = new byte[4096];
            int len;
            while ((len = is.read(buf)) >= 0)
                out.write(buf, 0, len);
        } catch (FileNotFoundException fnfx) {
        } catch (IOException openx) {
        } finally {
            try {
                if (out != null)
                out.close();
                if (is != null)
                    is.close();
            } catch (IOException closeInx) {
            }
        }
私が入れたら
try { 
if (is != null) is.close();
} catch (IOException closeInx) { }
try {
if (out != null) out.close(); 
} catch (IOException closeInx) { }
2番目のスタイルの最終ブロックでは、両方とも同じですか