My try-catch block is not working no matter what I do... I have to make my own custom exception class.
This is the assignment
My work so far.
My output
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...
Join our real-time social learning platform and learn together with your friends!