substring string cannot be converted to in t java code example Example: java convert String to int int i = Integer.parseInt(myString);