DEVFYI - Developer Resource - FYI

How is it possible for two String objects with identical values not to be equal under the == operator?

Java Interview Questions and Answers (part 2)


(Continued from previous question...)

308. How is it possible for two String objects with identical values not to be equal under the == operator?

The == operator compares two objects to determine if they are the same object in memory. It is possible for two String objects to have the same value, but located indifferent areas of memory.

(Continued on next question...)

Other Interview Questions