Originally Posted by
summit45
Yeah I got him, that's what I said, or so I thought lol. Well I didn't talk about that first if() without braces but yeah exactly, that's just it. If you put that println() inside the if(), and the person enters a right number (within range), the if() block doesn't execute, and it won't print. If they enter a wrong number (out of range), the if() block throws an exception, which stops it from executing further code, and so println() still doesn't run.
-summit45
The point is that the println() *does* run in the first example when the if statement evaluates to false. It's still a reachable statement. In the second example, there's no way that the code could execute to run the println() statement, hence the error.