Keyboard input/Obtain a Y or N response: Difference between revisions

Content added Content deleted
(New post.)
m (Formatting text.)
Line 1,110: Line 1,110:
The task specification that there should be no need for the user to press the enter key,
The task specification that there should be no need for the user to press the enter key,
creates an awkward situation for the Java language.
creates an awkward situation for the Java language.

However, a short program that waits for the user to press return can easily be constructed.
However, a short program that waits for the user to press return can easily be constructed.
<syntaxhighlight lang="java">
<syntaxhighlight lang="java">