java 什么情况下应该在方法中抛出SystemException

[复制链接]
查看11 | 回复2 | 2009-8-14 08:33:50 | 显示全部楼层 |阅读模式
抛出不同的exception就是为了见名知意如SQLException,就知道肯定是操作数据库的时候出了错RemoteException 一看就知道是远程方法调用的时候出错了IOException 一看就知道操作二进制流或文件出错了等等等等
回复

使用道具 举报

千问 | 2009-8-14 08:33:50 | 显示全部楼层
SystemException和XxxError应该都是JVM自己用的吧,最好不用吧。和普通的Exception没有区别,
回复

使用道具 举报

千问 | 2009-8-14 08:33:50 | 显示全部楼层
System exception means some runtime errors have occurred and generally speaking, you don't want to handle them.Another common type of exception is Application exceptions, that normally are generated by your application's code. You want to handle them properly, since they are from your application's logic.For instance, if a user want to access resources that are not permitted, you can throw security exception etc.
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行