Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

how can you say String objects are immutable and Stringbuffers are mutable

807603Jan 2 2008 — edited Jan 2 2008
suppose
String s1="ABCDEF";
s1="PQRST";


System.out.println(s1); it prints the PQRST
but here the sting object s1 is replaced with PQRST insted of that ABCDEF
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 30 2008
Added on Jan 2 2008
10 comments
239 views