Converting String to int??????? (Java)

imported_nautique

Senior member
Jul 14, 2004
346
0
0
I am reading in a value from the user as a string. But I need to use that value as an int value. Can you parse a string to an int? Or can someone tell me another way I should be doing this?

Thanks
 

boran

Golden Member
Jun 17, 2001
1,526
0
76
and be sure to have some error handling in case the user types in "one" instead of "1" ;)