79349403

Date: 2025-01-12 05:38:53
Score: 1.5
Natty:
Report link

This issue arises because Scanner.next() only reads until the next white space. When you press the enter after entering an invalid input, the newline character remains buffer. On the next iteration, next() might pick it up

And you use the scanner.nextLine() to clear the buffer introduces a new line in the output

Reasons:
  • No code block (0.5):
  • Low reputation (1):
Posted by: chirath hevavitharana