Answers for "how to write not equal to in java for string"

3

java string not equal

String name = "John"; 
 
// prints true to standard system output. 
System.out.print(!name.equals("Alex"));
Posted by: Guest on October-03-2020
0

Java equal string

String first = "Hello";
String second = "hELLo";

if(first.equal(second)) { 
	// Check if first string is equal to second string. lower/upper case matter.
}

if(first.equalsIgnoreCase(second)) {
	// Check if first string is equal to second string. lower/upper does not matter.
}
Posted by: Guest on April-29-2022

Code answers related to "how to write not equal to in java for string"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language