摘要:
我们经常为用到Integer.valueOf(String str)这个方法,如果字符串格式不对,这个方法会抛出一个系统异常NumberFormatException这里我们就要分析一下这个方法,其中Byte,Short也是调用了Ingeter中的方法.在Integer类中的定义如下:public static Integer valueOf(String s) throws NumberFormatException{return new Integer(parseInt(s, 10));}这里因为parseInt方法返回的int型的,这里调用了一个构造函数产生了一个新的Integer实例. 阅读全文
posted @ 2011-11-06 00:54
_ccx
阅读(266)
评论(0)
推荐(0)
浙公网安备 33010602011771号