why? It is because ==
the memory addresses of two objects are compared. We know that when the variable is created, it is equivalent to opening up space in the memory . In the case, the str
sum str1
is two different spaces occupied, so their memory addresses are inconsistent. in use ==
, when the symbol is determined on not equal , and that is false
.
Judge whether the strings are equal or not ==
Guess you like
Origin blog.csdn.net/qq_45783660/article/details/114034399
Recommended
Ranking