Answers for "java test if strings are equal"

2

java test if strings are equal

//This expression is true if str1 and str2 are equal, and false if they're not
str1.equals(str2)

//example use case:
String location = "London";
String destination = "London";
if (location.equals(destination)) {
	System.out.println("You have arrived!");
}
Posted by: Guest on April-21-2021

Code answers related to "java test if strings are equal"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language