While working on a code, I was wondering if I could avoid try n catch and used something else. For example, if i have a value(from console) of type double and if user enters a string or something else then there should be a prompt to re-enter the value.
I know this can be done very easily using try-n-catch but how can we do it without it, is there any way out?
Please give an example if possible.
doublevalidation. It's quite a roundabout way of second-guessingparseDoubles result, and it's complex. There's scientific notation, four different limits to check, ...