In simple words, == checks if both objects point to the same memory location whereas . equals() evaluates to the comparison of values in the objects .23 Şub 2022
Read moreCan you do string == string?
That’s why == often doesn’t work on Strings ; Strings are objects, and doing == on two string variables just compares if the address is same in memory, as others have pointed out. .
Read more