Javatpoint Logo
Javatpoint Logo

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

Following program demonstrate it.

File: ProveStringImmutable .java


Before Modification in st1
Both pointing to the same reference
After Modification
Both are pointing to different reference
Next TopicJava String FAQs

Youtube For Videos Join Our Youtube Channel: Join Now


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Trending Technologies

B.Tech / MCA