首页 > 代码库 > [Android学习笔记]try-catch

[Android学习笔记]try-catch

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