That's one of the quirky ways java optimizes strings. Instead of creating multiple constant strings, sometimes the Java compiler will recognize that it already has that object and just assigns the...
Type: Posts; User: helloworld922
That's one of the quirky ways java optimizes strings. Instead of creating multiple constant strings, sometimes the Java compiler will recognize that it already has that object and just assigns the...
Yes, that's exactly why.
Say we had the two variables:
Object A and Object B.
The value contained by A and B are addresses to where some objects are.
If A==B, then they are pointing to...
Not true, != and == are very useful for comparing if two objects are the same object, not if they contain the same data.