The parseInt method of Integer class generally used to convert String to Integer
It parses the string argument as a signed decimal integer.
The characters in the string must all be decimal digits, except that the first character may be '-' or '+'.
It will throw a NumberFormatException exception if the string does not contain a parsable integer.
public class Lautturi {
public static void main(String[] args) {
Integer i = Integer.parseInt("1234");
System.out.println(i);
}
}