Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link
I compiled and ran your code using 1.5.0, and got "False False" as output. (The toString method is creating new Strings at runtime, so these are different references.)
Can you verify your output? [ November 01, 2004: Message edited by: marc weber ]
"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer sscce.org
thanks for taking the time to answer, I am also using 1.5 but I am getting the output that I had mentioned - what output are you getting and and can u explain it ? thanks
The output I get is "False False." The toString method of Byte is returning a new runtime String instance each time it's called, and == is a shallow comparision of references.
b1.toString() is one reference, and b1.toString() is another, so the == comparison returns false. (These are not literals in the pool.)
Of course, the deeper equals() comparison returns true.
"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer sscce.org
i have the same thought with marc weber and my compiler tell me that the result is "falsefalse"
Step one step back to learn more thing..!!<br />Post to learn<br />learn from mistake<br />take whatever i understand...!!!<br /> <br />SCJP 1.4, Brainbench Java 1 & 2.<br />SCWCD 1.4 (preparing...!!)