D E said:
Ok this post was unclear... read below
.....
"this" being this line of code:
//begin code segment
String strComparer = "test2";
if ("test1".equals(strComparer) ) then
System.out.println("strComparer should output \"test1\"");
//end code segment
won't work.
The term "won't work", "doesn't work", etc. etc. has no meaning when it
comes to problem resolution.
So, I will speculate (since it is forced by your lack of contextual
information).
It doesn't compile ?
Incorrect, yes it does.
The expression evaluates to false ?
Yes, it does.
The output is unexpected ?
Well, to me, it's perfectly fine, what were you expecting ?
Java doesn't work ?
<sarcasm>Oh, you found the bug in boolean expressions giving ad hoc
behaviour that all of use millions have spent years looking for</sarcasm>
Without more information, speculative answers are all you'll get.
--
Tony Morris
(BInfTech, Cert 3 I.T.)
Software Engineer
(2003 VTR1000F)
Sun Certified Programmer for the Java 2 Platform (1.4)
Sun Certified Developer for the Java 2 Platform