View Single Post
  #1 (permalink)  
Old 05-17-2007, 07:14 AM
anjanesh anjanesh is offline
Member
 
Join Date: May 2007
Location: Mumbai, India
Posts: 5
anjanesh is on a distinguished road
Strings are immutable yet they can be changed ?
Hi

Trying to get the hang of Java.

In the String doc, its mentioned :
Quote:
Strings are constant; their values cannot be changed after they are created. String buffers support mutable strings.
But in that case how come this works ?

PHP Code:
String s "abcde"System.out.println(s);
"12345"System.out.println(s); 
Thanks
Reply With Quote
Sponsored Links