My try-catch block is not working no matter what I do... I have to make my own custom exception class.
Stacey Warren - Expert brainly.com
Hey! We 've verified this expert answer for you, click below to unlock the details :)
At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga.
Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus.
Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.
I got my questions answered at brainly.com in under 10 minutes. Go to brainly.com now for free help!
Not the answer you are looking for? Search for more explanations.
I'm having a really hard time figuring out why i'm getting that error...
Your else statement is throwing the bad guess every time you use a non-number it seems, It is telling you the error is on line 34.
It seems to be working just fine....You put in "d" which caused your input mismatch exception to throw your bad guess exception.
But I see what you meant. You meant you needed it to continue after printing the message to the screen. You needed to add a call back to the method if they put in the wrong output, passing it the number of tries they've already done.
Oh! so i need to add a call to the method if after throwing the new exception? i'm not sure why the program crashes AFTER catching the exception. Shouldn't it be continuing...