How to convert String to Integer

To discuss Java SE, Java EE technologies.
打印 被阅读次数

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 );
}
}
登录后才可评论.