Reply To: How to convert String to int in Java

Reply To: How to convert String to int in Java

Home Forums JAVASCRIPT How to convert String to int in Java Reply To: How to convert String to int in Java

#33262
HARPAL SINGH
Keymaster

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);

valueOf ()returns a new or cached instance of java.lang.Integer
parseInt() returns primitive int.