A common conversion is taking a string from a web request parameter or parse a CSV from storage and converting it to a primitive data type or a Integer object in java. Below we will show various ways to convert string type objects to primitive data type. On the flip side we also show how to convert an int back to a string because there could be an instance you wish to operate on the value as a string. Remember that a NumberFormatException will be thrown in the even that you attempt to convert a string to a numeric type but it doesn't have an appropriate format.