• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

append AND concat

 
antraarora
Ranch Hand
Posts: 45
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is the difference between APPEND and CONCAT in strings?
 
jyothi godavarthy
Ranch Hand
Posts: 135
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
append we use for StringBuffer and concat for String. hope this helps.
 
antraarora
Ranch Hand
Posts: 45
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Jyothi!!! Does that mean if we use APPEND on Strings, it will give an error and if we use CONCAT for StringBuffer, it will give an error? Or will it still compile???
 
jyothi godavarthy
Ranch Hand
Posts: 135
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
right, append we can't use for Strings and same way concat for StringBuffer.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic