public static int parseInt(String s, int radix)
throws NumberFormatException
{
/*
* WARNING: This method may be invoked early during VM initialization
* before IntegerCache is initialized. Care must be taken to not use
* the valueOf method.
*/
if (s == null) {
//如果字符串为空,直接抛异常
throw new NumberFormatException("null");
}
if (radix < Character.MIN_RADIX) {
//如果进制小于2,抛异常
throw new NumberFormatException("radix " + radix +
" less than Character.MIN_RADIX");
}
if (ra
Integer的parseInt源码分析
最新推荐文章于 2024-02-25 23:12:29 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)