Integer.parseInt(String) If the String doesn't represent an integer, the method will throw a NumberFormatException. Otherwise, it returns the value of the int. Similar methods exist in the other numeric wrapper classes as well - Float, Double, Long, etc.