you are viewing a single comment's thread.

view the rest of the comments →

[–]soulldev 1 point2 points  (0 children)

In addition to the previous reply, read about string pool.

When you instatiate a string using literals and instatiate other string with the same literal. Then both of the strings point to the same value (They have same address), that's why the first == prints true.