Converts a String to an int in Java