将字符串
String str = "0xC0A80010";
转换成Integer类型的
Integer num = 0xC0A80010;
String str = "0xC0A80010";
转换成Integer类型的
Integer num = 0xC0A80010;
解决方案 »
- linux tomcat zip文件用java先上传再加压,报错to many open file(紧急求助)
- 求救!!!Springsecurity3相关问题
- 如何使用session bean的本地接口
- Tomcat5.5 为什么运行一段时间就会死掉?
- 这里插入数据 怎么不行啊
- 为什么我用的eclipse3.0 RC1保存不能自动编译呢?
- 谁研究过Struts自带的Example?他在显示Current Subscriptions是怎么做的?
- 问个问题,有没有连接上数据库,可以把数据库中的表的数据,转成xml文件,只需要指定选项就可以了!
- 如何用java读取Excel中的数据呢?(不使用ODBC方法)
- Connection reset by peer: JVM_recv in socket input stream read这个问题到底怎么解决?? 500分!!不够再给
- 请问myeclipse6.5+JDK1.6应该用什么版本的weblogic
- jacob 解析word的问题
Integer num = Integer.parseInt(str , 16);
Long hex = Long.parseLong(s, 16);
System.out.println(hex);
这个报java.lang.NumberFormatException:错误,不能直接转换
换long 或者 bigInteger 试试!
Long hex = Long.parseLong(s.replayAll("0x",""), 16);
System.out.println(hex);
String str = "0xC0A80010";前把所有的 0x 替换为空!
这样转换是可以成功,但是最后结果得不到0xC0A80010
Integer ss = 0xC0A80010;
Long longStr = Long.parseLong(str.substring(2), 16);
ss = new Integer(longStr.intValue());
System.out.println(ss);
System.out.println(Integer.toHexString(ss));-1062731760
c0a80010