The "== operator" indicates that the values of the variables are the same.
For reference type, the address must be the same
The "equals method" indicates that the value of the reference address is the same.
Roughly speaking, primitive types can be compared with "==". If you do not use "equals" for the reference type, you will not get the correct result when comparing the contents. I wonder if you can remember ...
Recommended Posts