DTechy
Dtechy is all in one Desrtination for Tech reviews, IT news, tutorials, IT guides, definitions and information about technology.
Home › Forums › JAVASCRIPT › How to convert String to int in Java › Reply To: How to convert String to int in Java
Here is the simple way to convert your string in to Int :
str = “129590” int new = Integer.parseInt(str); or Integer x = Integer.valueOf(str);
str = “129590”
int new = Integer.parseInt(str);
or
Integer x = Integer.valueOf(str);
valueOf ()returns a new or cached instance of java.lang.Integer parseInt() returns primitive int.