Convert from String to integer
public class Main { public static void main(String[] args) throws Exception { String str = "25"; int i = Integer.valueOf(str).intValue(); // or i = Integer.parseInt(str); } }