0
equals()
Didn't understand it fully There lies some confusion Need another example ??
1 Antwort
+ 1
in other languages you can (but shouldn't) use the == operator to compare strings.
in java they use .equals() as its counter part. it returns a boolean if im not mistaken, allowing you to use them within conditional statements.
String str1 = "text;
String str2 = "text;
if (str1.equals(str2)){
log. ("same");
}...
and so on.
hope this helps!