Write a code to prove that strings are immutable in java?

Following program demonstrate it.

File: ProveStringImmutable .java

Output:

Before Modification in st1
Both pointing to the same reference
After Modification
Both are pointing to different reference