Dec 9, 2003 #1 R17 Programmer Jan 20, 2003 267 PH i'm asking input from users of type integer... but when my user types alpha characters... i get an error... i want to display a message telling my users only numbers are acceptable?
i'm asking input from users of type integer... but when my user types alpha characters... i get an error... i want to display a message telling my users only numbers are acceptable?
Dec 10, 2003 #2 borbjo Programmer Mar 29, 2002 33 NO try { int i = Integer.parseInt(inputFromUser); } catch(NumberFormatException nfe) { // user did not enter integer, do something here. } Upvote 0 Downvote
try { int i = Integer.parseInt(inputFromUser); } catch(NumberFormatException nfe) { // user did not enter integer, do something here. }