Originally posted by Ernest Friedman-Hill:
There's also a "hasNextDouble()", which returns true if calling nextDouble() will work (i.e., won't throw an exception.)
Ernest, thanks for your help! We haven't covered exceptions yet being this is an intro. class. I looked up the hasNextDouble() method you suggested. It looks like something I can definitely use but the textbook was vague on it. Is it a method or a boolean variable. If it's a boolean I'd have to declare it as such before using but the "()" indicates it's a method???
Here's the section of code in question that I modified with hasNextDouble().
When I tried to compile, I got 67 errors. I'm surely needing more help. Thanks!
[ November 22, 2008: Message edited by: Benjamin Chau ]
New lines to avoid very long lines. CR[/edit]
[ November 22, 2008: Message edited by: Campbell Ritchie ]