Hey guys, I’m a beginner and I’m doing this exercise where I need to design a program that will generate a random number between 1 and 100 and then let the user guess the number and tell them whether the guess is too high or too low. Here’s the code:
When I run the program, there’s a NumberFormatException. I’ve read that this exception occurs when your input is an empty String, null, or a non-numeric String, whereas I entered an integer. I checked my code and I could not find anything wrong, but I’m not sure.
How do I solve this?