This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
William P O'Sullivan wrote:Try this ... It does work! ;)
The OP asked about
if i create string using new operator
. In that context (which I thought is what you were answering), it doesn't work at all.
And even in the context you posted, I wouldn't call it "working." The OP wants to compare the contents of 2 Strings. The code you posted doesn't do that. It happens to produce the same result for that particular case, but I don't call taht "working".