Java????????
???????????? ???????[ 2015/12/30 15:21:17 ] ????????java
????????????
????????exception??????????????exceptional event??????д??
?????????壺??????????????????????????????ж???????е??????????????????
????????????????з????????????????????????????????????????????????????????????????????????????й????????????Щ??????????????????????????????????????????????????????????????????????????????
???????????????????????????????????Щ????????????????Щ?????????????????????????????????????б????Щ????????????????????????á?????????б??????????????call??stack??
??????????????????????????????????????????????????????????????????????????????????????????????????????÷???????????????? ????????????????????????????????????????????????????????????????????????????????????????????????????????????????? ???????????????????????????????????????????????????????е???????????????????????????????
???????????????
?????κε???????Throwable????β??????????????????????°???????????Error / Exception????Error???????Java??????з?????????????????????λ???????Java???????????Error???????????? ????????????Errors????????????????????????????Error????????????????????Exception
????Exception?б?????????RuntimeException????????????????????????????????????κε???????????????????????????????????????????????????????????????????????RuntimeException
????A method is not required to declare in its throws clause any subclasses of RuntimeException that might be thrown during the execution of the method but not caught.
??????????????з???????????δ??????? RuntimeException ???κ??????????? throws ????н?????????
????? ???????????ò??“????”?????????????????ε????????????????????????????RuntimeException?????????ù??? Error??????????????RuntimeException????????????????????????????????????????Σ???<B>??????????? ???Error????JVM?????????????;RuntimeException?????????????????;checked exception ?????????????????</B>??
??????????????????ù??????????????Error?? RuntimeException????????μ??????????????????????Щ????????Checked Exception??????Error??RuntimeException??????Unchecked Exception.
?????????????Щ??????????????????????????????????о????е????????е??????????????????????????????????????????J2EE??????????
?????????????J2EE?????
??????????????????????????????????????????????????????doBusiness()????????
????public void doBusiness() throws xxxBusinessException
???????????????????????????????????????????????????RuntimeException ?? checked exception??
????????????????????????????????е???????y?RuntimeException????????????????????????????н?????????????Σ?
?????????????Struts?е????Action???????????????doExecute(....)?????doBusiness()???????
public void doAction(......)
{
try
{
xxx.doBusiness();
}
catch(Exception e)
{
if(e instanceof RuntimeException)
{
// catch runtime exception
// ?????????????????RuntimeException
// ???????????????????????????????????
// ?????????????????
}else
{
//checked exception such as xxxBusinessException
//?????????????????????
}
}
}
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11