The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
April 2001

Advertisement

Advertisement
where you can ask and answer Java programming questions.">
artima.com - a resource for Java and Jini developers
Artima | Search | Java | Design | JVM | Jini | Books | Seminars | Subscribe 


Java Answers Forum
April 2001

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:

Sponsored Links



Google
  Web Artima.com   
Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us