lostwebsite.net blog

Annex to the Lost Website

Bits on info on Java strings

with one comment

Update: I don’t keep IRC logs and thus cited the wrong guy. Sorry Vince.

On this blog entry I will take on an assertion stated by systemfault. He declared on the #programmeur IRC channel on Freenode that:

<systemfault> String foo = new  String("lol"); est pareil que String foo = "lol";
<systemfault> Quand le compilo voit: String foo = "lol";
              quand il compile, il va vraiment faire String foo = new String("lol");

Which in english means that:

String s = "hello";

is syntaxic sugar for:

String s = new String("hello");

See the rest at www.lostwebsite.net…

Written by fdgonthier

October 30, 2009 at 8:00 pm

One Response

Subscribe to comments with RSS.

  1. [...] might have hinted about in in my previous post on the subject of strings in Java, yet I did not realize the significance of String.intern() method. The following code sample [...]


Leave a Reply