Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to check if entered String is not a double/int?

843789Dec 3 2009 — edited Dec 3 2009
So, in a calculator program, how to check that the input string consists of just numbers? Because when trying to parse into a double non numbers crashes the program...

id like it to loop back to asking the number again. I was trying to do a check via a while and a for loop with no luck =/
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 31 2009
Added on Dec 3 2009
7 comments
405 views