Archive for the ‘Java’ Category
On String.intern()
Where the author realizes the significance of the String.intern() method
I 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 demonstrates the behavior of the String.intern() method, similar to what I demonstrated in the post.
Bits on info on Java strings
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");
