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)
評論
目前還沒有任何評論
登錄後才可評論.