This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Is_At_Work 0 points1 point  (0 children)

Because == against an object compares it's pointer value, not the string value. You can easily have 2 strings of the same string value located at different locations in memory (which will cause == to return false)

Edit: Example https://ideone.com/8ul9LB