???????????????????????????????????????????Ч?????????????????????????????????????????????????Щ???????????????????????????
??????????
???????????????????????????????????????????????????????Java?????????????????????????????????????????????????????????????????????????????try???????????????catch??????????????????????
?????? ???????????????????????????????????????????????catch???????????????????????????????δ???γ???????????????????????????д??????л?????????????м????顣?????????????????????????????????????????????readPreferences()?????????????????????????????JCheckbook??????????ó???????????????????????HTML??Web??á????????????????????????????????????????HTML????C/S?汾????????????????????????????????????????????Web???????????????? readPreferences()?????????????Щδ???????????????????????????????????????????????????????????????
???????????????????????粶??????????????????????????????????磬????????readPreferences()?????????FileInputStream???????????????????????????FileNotFoundException???????????????????
????public void readPreferences(String filename){
????//...
????InputStream in = null;
????// DO NOT DO THIS!!!
????try{
????in = new FileInputStream(filename);
????}
????catch (FileNotFoundException e){
????logger.log(e);
????}
????in.read(...);
????//...
????}
?????? ????????????????????FileNotFoundException?л????????????2??????????????????????????????????????????????? readPreferences()??????????????????????????????????FileNotFoundException?????????????????? ????????????????????????????????????????ж????????????????????????????????in???????? NullPointerException???????
????????????????????????????????????????????????NullPointerException?????????????????????????????塣????????????????????????????????????FileNotFoundException??????NullPointerException??????????????????????? ????????????NullPointerException?????????????????п??????ü??η???????ú?????????????????????????С???????????????????????????????????????????????????????
???????readPreferences() ??????????????鯔???????Щ??????????????????????е??????????????????????????????????????????????????????ν??? readPreferences()???????????????о????????????????????????????п????????????????????????????????????????е??? ?????????????????
??????????????????????????????δ????????????????throws?????????????????????????????????????????á????????????????????????????????????????????????????磬“??????”?汾??readPreferences()?????????????
????public void readPreferences(String filename)
????throws IllegalArgumentException??
????FileNotFoundException?? IOException{
????if (filename == null){
????throw new IllegalArgumentException("filename is null");
????}  //if
????//...
????InputStream in = new FileInputStream(filename);
????//...
????}
?????? ??????????????????????????IOException???????????????????????????FileNotFoundException?? IllegalArgumentException????????????????????????????????RuntimeException???????????????????? ?????????????????Щ?????????????JavaDocs?б??????????
??????????????????????????????????????????????????????????????沶??????????????????????????????????????????????????????? ??????????????????????????????????????????????л??????????????????????Σ?????????????????????????沶????????????洦???
????????
?????????????????????????????????????????????????????????????????????????????????????????????????????????Э?????????????????????????????????????????á?