Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

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");
}
Comment

PREVIOUS NEXT
Code Example
Java :: boolean operators in java 
Java :: difference between getcontext and getapplicationcontext in android 
Java :: how to remove letters from string java 
Java :: java.lang.double cannot be cast to java.lang.float 
Java :: how to get the memory location of an object in java 
Java :: java swing border 
Java :: math square java 
Java :: what is a cache-less reload 
Java :: mettre caractère de string en majuscule java 
Java :: java zahlen runden auf 1 nachkommastelle 
Java :: next method jdbc 
Java :: java string 
Java :: width and height of screen java 
Java :: java use parent method 
Java :: how to find odd and even in a array 
Java :: how to insert a 0 in an array java 
Java :: click on recyclerview item android animation 
Java :: refreshing method() android studio webview 
Java :: java packages example 
Java :: Java empty() Method 
Java :: math class in java 
Java :: java check prime number 
Java :: Java @Deprecated annotation 
Java :: Java List Access Elements using get() method 
Java :: get string size 
Java :: convert json to xml in java 
Java :: menu alert dialog in android 
Java :: recursion java fibonacci 
Java :: Java forEach() Method 
Java :: how to create microservices architecture with spring boot 
ADD CONTENT
Topic
Content
Source link
Name
7+5 =