Java NumberFormatException

在编写项目代码时出现的一切不可控因素都要进行处理。

 

昨天写的

1 Integer count = Integer.parseInt(countStr);
2 
3 //如果不处理,很有可能出现Exception
4 
5 try{
6         Integer count = Integer.parseInt(countStr);
7 }catch(NumberFormatException e){
8         return false;
9 }

 

 

最后:认真对待你写的每行代码,尽管他就是个测试

 

posted @ 2015-08-04 09:52  _Doraemon  阅读(704)  评论(0编辑  收藏  举报