• 0

JAVA: Getting the press any key to continue thing


Question

Hey guys as the thread name implies, how do u do it, im doing console programming in java, and i wann know how to do the press any key to continue thing, so watever key is pressed then it does something, i know how to read user input but i dont think thats how to do it. Thanks

12 answers to this question

Recommended Posts

  • 0

ummm so wait

public void Test()

{

[this is a block of code that's executed]

System.out.println("Pressr to return to menu");

System.in.read();

}

ummm but cant i put it in a if statement becoz i need to know when enter has been pressed so that i can call another method

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

    • Nope. This will be disabled instantly on all my devices. But at least they're not forcing it upon users, it can be turned off.
    • But, but, Meta did not have address to your data? I don’t believe this cap. Why-o-why don’t I trust them?!
    • They're not lying in this case, violating your privacy and safety is certainly of utmost importance to Zuck and his creeps...
    • Microsoft employee behind AnduinOS releases more updates, here's how to upgrade by Paul Hill A small Linux distribution created by a Microsoft employee drew quite a bit of attention in recent months with its attempts to ease users into Linux by looking just like Windows. This week, AnduinOS was upgraded to a new batch of point releases, including 1.3.3, 1.2.6, and 1.1.6. These point releases do not bring too many changes, and all the changes that are introduced are identical across all three versions. Here are the release notes this time: Fixed an accessibility issue that caused the screen reader unable to read the text. Added librime-plugin-lua for ibus-rime users to support Lua scripts. This only affects zh_CN by default. Added policykit-desktop-privileges to the default app list to allow no-password prompts for mount, simple updates, etc. As a new Linux distribution on the scene, updating it is not as straightforward as opening a software store and tapping the upgrade button. For now, upgrades rely on a script. To update your computer using this script, open up a terminal window and type do_anduinos_upgrade. Running this command will bring you up to the latest point release for your respective major version, even if you’re not on the latest point release right now. In the future, Anduin Xue, the Microsoft employee who develops AnduinOS, wants to allow you to grab new versions via sudo apt upgrade. For the time being, users will need to stick to running the script to ensure their device is up to date. Last month, it was announced that AnduinOS 1.4 will be based on Ubuntu 25.10 and will drop in late October, while Anduin OS 1.5 will be based on Ubuntu 26.04 LTS and arrive in late April 2026. Hopefully, we will see more maturation with those updates, such as upgrading the system with an apt command instead of a script.
    • I know companies like to assume first party ads are okay, and I often don't have a huge problem with things like extra iCloud space offers showing up in relevant places. Relevant being the keyword. There is literally nowhere on a phone where a movie ad would ever be in context.
  • Recent Achievements

    • First Post
      solidox earned a badge
      First Post
    • First Post
      BA the Curmudgeon earned a badge
      First Post
    • One Year In
      blissa jayden earned a badge
      One Year In
    • One Month Later
      blissa jayden earned a badge
      One Month Later
    • Week One Done
      blissa jayden earned a badge
      Week One Done
  • Popular Contributors

    1. 1
      +primortal
      561
    2. 2
      ATLien_0
      213
    3. 3
      +FloatingFatMan
      171
    4. 4
      Michael Scrip
      152
    5. 5
      Som
      151
  • Tell a friend

    Love Neowin? Tell a friend!