How can I convert a String to an int in Java?

2.42K viewsJava
0

I have a string with the number and I want to convert as an int.

For example :
String as “125685”, the expected output is 125685.

Changed status to publish
Add a Comment
0

String stringNumber=”1236547″;

int intNumber=Integer.parseInt(stringNumber); //here we are converting String to Integer
manohar Changed status to publish 51 mins ago

Changed status to publish
Add a Comment
Write your answer.