Today is a long time to see. Know the difference between the equal and = = that are not noticed at ordinary times.
either = = or equal are used to compare the same or not. When the problem is here, what's the difference?
My daily comparison is nothing more than two kinds: 1, the comparison between the basic data types, 2, the comparison between the reference type data.
1. When comparing the basic data types. = = is the same as equal. is a comparison of two values that are the same, and the same as true differs from false.
2. When comparing the reference data types. = = is the same as equal, which is the same as the address in the stack memory, the same as true. The difference is false.
In general, there will always be a very individual thorn head, here is no exception. String. We all know that this is a special reference type, for two string comparisons, whether = = or equal
The comparison between the two comparisons is whether the strings are identical.
Extension: We know that if you create two string objects, the address of the memory is different.
= = and the sentiment of equal application in Java