关闭流的操作,写在try-catch外面和写在finally里面有什么区别,都会执行的呀??!

关闭流的操作,写在try-catch外面和写在finally里面有什么区别,都会执行的呀??!
public void test1() {
    BufferedOutputStream bos = null;
    try{
        bos = new BufferedOutputStream(new FileOutputStream("d:/123.txt"));
    }catch (Exception e){
        System.out.println(e.getMessage());
    } finally {
        try {
            bos.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

}
public void test2(){
    BufferedOutputStream bos = null;
    try{
        bos = new BufferedOutputStream(new FileOutputStream("d:/123.txt"));
    }catch (Exception e){
        System.out.println(e.getMessage());
    }

    try {
        bos.close();
    } catch (IOException e) {
        e.printStackTrace();
    }
}
像这种情况,是不是效果都是一样的,哪种写法好一点

效果没区别,但是如果第一个在catch抛了异常,第二种写法不会关闭流