You can convert a String to integer using parseInt() method of Integer wrapper class or using valueOf() and intValue() methods together as follows.
String str = "10"; int i = Integer.valueOf(str).intValue(); or int i = Integer.parseInt(str); // possible exception here
Post a Comment
0 comments:
Post a Comment