Java Code Examples

To discuss Java SE, Java EE technologies.
正文

How to convert String to Integer

(2008-08-24 12:26:37) 下一个
The codes below show you how to convert String to Integer in Java.

The copyright of the codes belongs to www.javaeecoding.com 

public class StringToIntConverter 
{
public static void main(String args[])
{
String str = "598";

int int1 = Integer.parseInt(str);
System.out.println( "int1 = " + int1 );
}
}
[ 打印 ]
阅读 ()评论 (0)
评论
目前还没有任何评论
登录后才可评论.