Code: Select all
String s = null;
s = s + 'c';
Moderator: admin
Code: Select all
String s = null;
s = s + 'c';
The explanation indeed is correct somehow, but without the details of Agoosen it sounds like null == "null". In my opinion it would help a lot to include those details in the explanation.admin wrote:Actually, the given explanation is correct but it skipped the details that you've mentioned. These details are covered in other questions.
thanks a lot. Much easier to accept it that wayIf the reference is null, it is converted to the string "null" (four ASCII characters n, u, l, l).
and true for newStr.equals(myStr)
I have the same concern as you.Chanandler wrote: ↑Thu Aug 25, 2016 1:36 pmDid something go wrong here?
Look for correct/green answer and the explanation:and true for newStr.equals(myStr)
The reply to this query is there at the top of this page.itvase wrote: ↑Thu Jan 11, 2024 11:50 pmI have the same concern as you.Chanandler wrote: ↑Thu Aug 25, 2016 1:36 pmDid something go wrong here?
Look for correct/green answer and the explanation:and true for newStr.equals(myStr)
It's strange that admin hasn't responded to this for more than 7 years.
Users browsing this forum: No registered users and 50 guests