Sponsored Link •
|
Advertisement
|
Advertisement
|
This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.
Message:
String values are Objects. You compare Objects using the .equals() method. So, your code above would be: When you use the == operator on Objects, what you're really doing is comparing the Object references. So, this is equivalent to asking, "Does the object reference on the left side of the == point to the same address in memory as the object reference on the right side of the ==?" Replies: |
Sponsored Links
|