📜  为什么我的 if 语句不适用于 java 代码示例中的输入

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

代码示例1
//it does not seem to work for me with using the double equal sign in 
//the if statement (==). Instead, try this. 

Scanner input = new Scanner(System.in);

System.out.print("This is the user's input prompt: ");
var userInput = input.next();

if(userInput.equals("it is working")) {
    System.out.println("Thank the lord");
}