Java Programming Tutorial - 82 - Exception Handling
Loading...
69,691
Loading...
Top Comments
see all
Video Responses
see all
All Comments (171)
-
So we had ifception, now it's catch 22
-
@hashtit Cuz, in buckys tutorials, you go ahead and make sure you haue speleed everryting rong
-
to Spielberg2Cents, why have you spelt, dividing as "diving", just saying...
-
only 66,000 people really liked java and tried to learn it... im one of em
-
I accidentally typed in a letter...the Loop is never stopping. Explain please...
-
@tatersalad58 you dont, its gonna just read another num
just at the start of the loop we need to clear wrong input data using
input.reset();
-
Yaayyy atlast..a new and meaningful main class name
-
helpful
-
@molle7397 It wont let me post the code, can I PM you my email?
-
@molle7397 I think I might of fixed it, I'll send you another reply if it doesn't work out.
Loading...
Why is your variable named sum when you're diving??? ;-) .. just saying.. :-D
Spielberg2Cents 6 months ago 27
For you guys that are getting infinite loops when entering an invalid character, such as a letter, you will need to call next() on your scanner inside the catch clause to clear the invalid data from the scanner, else, you will be looping over invalid data.
tatersalad58 3 months ago 11