异常处理 [英] Exception Handling

查看:145
本文介绍了异常处理的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我读的地方不例外手柄的Andr​​oid开发时,是真的吗?

I read somewhere not to exception handle when developing in Android, is that true?

如果一个人确实需要例外手柄是否有任何日志记录工具2.1及以上?

If one does need to exception handle are there any logging tools for 2.1 and above?

如果不能例外处理,为什么不建议至少使用以下?
尝试{
    身体 - code
}赶上(异常类名变量名){
    handler- code
}

If shouldn't exception handle, why is it not recommended to at least use the below? try { body-code } catch (exception-classname variable-name) { handler-code }

推荐答案

这是不正确的,总有你需要尝试catch异常处理code场景。有建于记录的,你可以张贴严重性级别的消息并查看在调试时或做一些部署的应用程序,如某处送他们更加有用。

This is not true, there are always scenarios where you need try catch exception handling code. There are built in logging classes that you can post messages with severity levels to and view while debugging or do something more useful for deployed apps like sending them somewhere.

这篇关于异常处理的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆