Open linrio opened 7 years ago
In java, if we want to compare two string, such as A= 'abc' and B = 'abc', we should use: if(A.equals(B)){} . It return true orfalse. Not if(A == B) It return the whether the memory address is the same.
if(A.equals(B)){}
true
false
if(A == B)
In java, if we want to compare two string, such as A= 'abc' and B = 'abc', we should use:
if(A.equals(B)){}
. It returntrue
orfalse
.Not
if(A == B)
It return the whether the memory address is the same.