Answers for "what does .compare do in java"

1

string comparison using == in java

In Java Strings, the == operator is used to check the reference of both the string objects.
Use .equals method instead:
str1.equals(str2)
Posted by: Guest on December-13-2021

Code answers related to "what does .compare do in java"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language