Java: String to Integer



You can convert a String to integer using parseInt() method of Integer wrapper class or using valueOf() and intValue() methods together as follows.
str = "25";
int i = Integer.valueOf(str).intValue();
or
int i = Integer.parseInt(str);