How to convert String to Integer

漂亮狗 (2008-08-24 12:26:37) 评论 (0)

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 );
}
}