怎么样才能把string类型的"100"转换成 int类型的 100 ? Interger.parseInt(string);就可以了 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 Integer i=new Integer(0);int target = i.parseInt(yourString); 其实你的Interger定义成什么数值都无问题的 看如下代码:String xh=request.getParameter("id"); int x=Int.valueOf(xh).IntValue();用下面这句就好了 How do I convert strings to numbers?class ConvertTest { public static void main (String args[]) { String str; str = "25"; int i = Integer.valueOf(str).intValue(); System.out.println(i); long l = Long.valueOf(str).longValue(); System.out.println(l); str = "25.6"; float f = Float.valueOf(str).floatValue(); System.out.println(f); double d = Double.valueOf(str).doubleValue(); System.out.println(d); } } spring mvc 异常处理 速救啊!!jsp,ajax请求struts1 action乱码啊!!!! IText读写PDF 初学servlet的菜鸟问题,麻烦了 读取pdf模板文件,并对其进行编辑保存? 刚刚学习struts,请帮忙!! <jsp网站开发四酷全书>里的例子有谁配置成功的? 求教javascript!!!!!!!!!!!!!!!!!!!!!!!! 菜鸟在线求助关于类与对象的问题 JSP的虚拟问题 如何解决tomcat4.0中的这个问题 哪有jive的最新源码?
int target = i.parseInt(yourString);
其实你的Interger定义成什么数值都无问题的
String xh=request.getParameter("id");
int x=Int.valueOf(xh).IntValue();
用下面这句就好了
str = "25";
int i = Integer.valueOf(str).intValue();
System.out.println(i);
long l = Long.valueOf(str).longValue();
System.out.println(l); str = "25.6";
float f = Float.valueOf(str).floatValue();
System.out.println(f);
double d = Double.valueOf(str).doubleValue();
System.out.println(d);
}
}