擅长:python、mysql、java
<p>字符串对象本身是不可变的。</p>
<p>指向字符串的变量<code>a</code>是可变的。</p>
<p>考虑:</p>
<pre><code>a = "Foo"
# a now points to "Foo"
b = a
# b points to the same "Foo" that a points to
a = a + a
# a points to the new string "FooFoo", but b still points to the old "Foo"
print a
print b
# Outputs:
# FooFoo
# Foo
# Observe that b hasn't changed, even though a has.
</code></pre>