Answers for "why are my if statements not working with inputs in java"

0

why are my if statements not working with inputs in java

//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");
}
Posted by: Guest on December-03-2020

Code answers related to "why are my if statements not working with inputs in java"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language