Suppose you have a string “10.001” and you want to convert it to a primitive integer, first convert the string to a Double, then cast it to an int.
String value = "10.001";
int intValue = (int)Double.parseDouble(value);
Suppose you have a string “10.001” and you want to convert it to a primitive integer, first convert the string to a Double, then cast it to an int.
String value = "10.001";
int intValue = (int)Double.parseDouble(value);