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!

using isnum

843789Apr 28 2009 — edited Apr 28 2009
I want to check that the content of a text field is numeric. When I try:
if (isnum(answerString)==false) {
//my code
}
I am told the operator == cannot be used with isnum, boolean. When I try:
if (isnum(answerString)) {
//my code reversed
}
I am advised that a boolean was required and isnum was found.

Is there a quick and easy way of doing this correctly?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 26 2009
Added on Apr 28 2009
9 comments
258 views