String to Integer in Java

//String to integer
class Convert
{
public static void main(String[] args) {

String str = "420";
int intval = Integer.parseInt(str);
System.out.println("integer value:"+intval);
}
}