if i ask for a string through bufferReader i.e
a telephone number 5554444
how can i stop a letter being entered instead of a number
thanks
Printable View
if i ask for a string through bufferReader i.e
a telephone number 5554444
how can i stop a letter being entered instead of a number
thanks
Not directly. You could read character per character and check each one. Or you could use a read-integer function (don't know if there is one), but it wouldn't hinder the user from entering a letter, it would only make the function throw an exception.
thanks i will check that way out
or u can put the string u get into Integer.parseInt(String s)
if this can't make it into an integer it throws an exception