Java??????
???????????? ???????[ 2012/12/25 9:53:59 ] ????????
??????飺????????java??????????????????Three Rules for effective Exception Handling?????????????????????????????????debug??????н???????????????
????????????
?????????????
???????????
????java???????????????????????????????????????????Thinking in java????????Bruce Eckel????????????????????java?е??????????Error??Exception??????????????????????????????Throwable??Error????JVM?????з??????Щ????????????????????????????????ЩError???????????????????StackOverflowError?????????????????????????????????????????????????JVM????Exception?????????????????Щ??????????????????????????????????????????????????????????Exception????????????????checked????δ????????unchecked???????????????????????????????????????try..catch??????????????????????????????????Щ?????????????????? NullPointerException ??????????????????RuntimeException??java?????????????????????????ü???????????????sun????????????????checked????unchecked????????????????????????java?????????????????
???????????
?????????????java???Щ?????????????????????????????Щ?????????IOException??SQLException?????Щ?????????????????????????????????????????в?????????????????try..catch??????????????????д?????????????try??????д????????????????????catch?????н??в??????????catch?????д???????Exception????????ζ??????????????????е??????????????????????????д??????????????finally???????????У?????????????洦???Щ????????????????????????????????????????
????????????????????????????try??????е??catch??finally??????????????????catche???????????ж?????????try?????п????????????????????????????????д???catch???????????????????????????д?????£?
1.try{
2. // ..invoke some methods that may throw exceptions
3.}catch(ExceptionType1 e){
4. //...handle exception
5.}catch(ExceptionType2 e){
6. //...handle exception
7.}catch(Exception e){
8. //...handle exception
9.}finally{
10. //..do some cleaning :close the file db etc.
11.}
???????????????????type?????exception??????????????????д?????????switch case????????????????????????catch???????????????????????е??????break??case?????????????catch??Exception??????д????棬catch?????????????????Exception?????????????????
??????????try..catch?????????????????????????????????????“3????”???????????????????????????try??????????е??????????????????????????????????·????????????ó????????fillInStackTrace()??Throwable????????????????????????????????????????????????????????????StackOverFlow???????й???η???????????????? ???????????try?????????????????????????????????????????????Ч???goto??????????????????????????????д????????????
????????????????????try catch??????????????????Ч???????????????????á?
??????
???·???
??????????????????
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