标签: java
如何显示输出(W IS PRESSED)直到我按下w并且当我释放w然后输出将显示为(W被释放)。
System.out.println("HI"); Scanner s = new Scanner(System.in); String str = s.nextLine(); while(str.equals("w")) { System.out.println("W IS PRESSED"); }