Well, considering that you're generating the random number inside the loop, it changes every time the loop repeats. Are you sure that's what you wanted?
db
Type: Posts; User: Darryl.Burke
Well, considering that you're generating the random number inside the loop, it changes every time the loop repeats. Are you sure that's what you wanted?
db
Scanner#nextInt doesn't consume the newLine, which remains in the scanner's buffer and is consumed when you next call Scanner#nextLine. You need a "dummy" nextLine to clear the buffer.
userGuess =...