首页 > 移动平台 > 详细

[Android学习笔记]try-catch

时间:2014-12-22 15:50:42      阅读:236      评论:0      收藏:0      [点我收藏+]
private boolean test() {
        boolean result = true;
        String str = null;
        try {
            Log.d("test","出现异常之前");
            int length = str.length();
            Log.d("test","出现异常之后");
        } catch (Exception e) {
            result = true;
            Log.d("test","catch块");
        }
        result = false;
        Log.d("test","catch执行完成之后");
        return result;
    }

技术分享

[Android学习笔记]try-catch

原文:http://www.cnblogs.com/hellenism/p/4178142.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!