> This example is not quite true.  String objects are unique because duplicates
> are stored as one in memory.  Therefore your example of a and b both being
equal
> to "abc" will be TRUE using "==".  This is because the "==" compares if the
> pointer for each is equal and since they are both String objects, they are
both
> pointing to the same address in memory.  Your explanation holds true for any
> object other than Strings.

I thought this was settled already with the correct answer a few posts ago!
:-)

If a and b reference distinct String objects containing the same sequence of
characters a.equals(b) is true but a==b is false.

Mike

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html

Reply via email to