• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

String & StringBuffer -- Difference

 
Makesh Sundaresan
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what is the between String & StringBuffer ?
Advance Thanx.
 
mira yang
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
String object can not be changeed,but StringBuffer object can.
When you want to change a String object( Example: use method replace('a','b')),in fact, it create a new String Object and return it to you.
 
Vicken Karaoghlanian
Ranch Hand
Posts: 522
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
in other words 'String' object are immutable while 'Stringbuffer' object are mutable.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic