• 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.