This page contains an archived post to the Java Answers Forum made prior to February 25, 2002.
If you wish to participate in discussions, please visit the new
Artima Forums.
Message:
why is that string buffer is mutable and string immutable
Posted by Alex on May 11, 2001 at 6:55 PM
> why is that string buffer is mutable and string immutable? when you do String var = "aaa"; and then var = "bbb"; Java will do equivalent of 1) var = new String("aaa"); then 2) var = new String("bbb"); It creates different object at the pointer var, not sets some property
Replies:
|