📜  java while loop q 退出 - Java 代码示例

📅  最后修改于: 2022-03-11 14:52:04.214000             🧑  作者: Mango

代码示例1
while(!choice.equals("q")){
    System.out.println("Enter a number or q to quit");
    choice = input.next();

    if(!choice.equals("q")){
        int number = Integer.parseInt(choice);
    }
}