• 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

  • Recent Achievements

    • Collaborator
      Mighty Pen went up a rank
      Collaborator
    • Week One Done
      emptyother earned a badge
      Week One Done
    • Week One Done
      DarkWun earned a badge
      Week One Done
    • Very Popular
      valkyr09 earned a badge
      Very Popular
    • Week One Done
      suprememobiles earned a badge
      Week One Done
  • Popular Contributors

    1. 1
      +primortal
      568
    2. 2
      +FloatingFatMan
      180
    3. 3
      ATLien_0
      176
    4. 4
      Xenon
      116
    5. 5
      Som
      110
  • Tell a friend

    Love Neowin? Tell a friend!