0

How to display output (W IS PRESSED) until i press w and when i release w then output will display as (W is released).

System.out.println("HI");
Scanner s = new Scanner(System.in);
String str = s.nextLine();
while(str.equals("w"))
{
    System.out.println("W IS PRESSED");
}
einverne
  • 6,454
  • 6
  • 45
  • 91
Mark
  • 69
  • 5

0 Answers0