码迷,mamicode.com
首页 > 其他好文 > 详细

对象初始化异常

时间:2018-10-07 18:55:21      阅读:145      评论:0      收藏:0      [点我收藏+]

标签:rac   color   cep   exception   tput   cat   eth   初始   method   

        // 如果不进行初始化,当 未进行初始化 + new失败时,引用地址可能胡乱引用。
        OutputStream os = null;
        try {
            os = excepThrowMethod();
        } finally {
            if (os != null){
                try {
                    os.close();
                } catch (IOException e) {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
                }
            }
        }

 

对象初始化异常

标签:rac   color   cep   exception   tput   cat   eth   初始   method   

原文地址:https://www.cnblogs.com/wenlin-gk/p/9750702.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!