Integer i = new Integer("0x10"); 编译不报错,为什么运行会出异常啊,不可以转换吗?
解决方案 »
- 鼠标适配器问题,求指教,错在哪里怎么改?
- SWT的image如何按比例缩小?
- 原来JAVA...
- SWT中画图canvas后怎么生成JPEG图像啊?求救!
- //请关注一下吧,这个问题好多人都没有解决得了,急急急..........!
- 请教Manifest用法
- 急问e的x次方在java中有没有现成的函数?
- 各位好心人帮帮我教教我的MSN说话吧!
- 简单问题:如何保证界面的字体一致,在哪里设置?
- java JDBC连接 Unknown database '/aaa'
- IIS与tomcat整合,端口通用80无法访问,tomcat8080端口就可以,求解析
- Myeclipse选中一个类或对象的时候,同一类型不显示灰色了怎么调回来!新手求指导
throws NumberFormatException
Constructs a newly allocated Integer object that represents the int value indicated by the String parameter. The string is converted to an int value in exactly the manner used by the parseInt method for radix 10.
那个是字符串,去掉双引号...........
Integer
public Integer(int value)构造一个新分配的 Integer 对象,它表示指定的 int 值。 参数:
value - Integer 对象表示的值。--------------------------------------------------------------------------------Integer
public Integer(String s)
throws NumberFormatException构造一个新分配的 Integer 对象,它表示 String 参数所指示的 int 值。使用与 parseInt 方法(对基数为 10 的值)相同的方式将该字符串转换成 int 值。 参数:
s - 要转换为 Integer 的 String。
抛出:
NumberFormatException - 如果 String 不包含可解析的整数。
另请参见:
parseInt(java.lang.String, int)Integer i = new Integer(55);
Integer s = new Integer(zhaoming);