This week's book giveaway is in the Big Data forum.
We're giving away four copies of Elasticsearch in Action and have Radu Gheorghe & Matthew Lee Hinman on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes append AND concat Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Elasticsearch in Action this week in the Big Data forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "append AND concat" Watch "append AND concat" New topic
Author

append AND concat

antraarora
Ranch Hand

Joined: Jul 27, 2000
Posts: 45
What is the difference between APPEND and CONCAT in strings?
jyothi godavarthy
Ranch Hand

Joined: Jan 28, 2004
Posts: 135
append we use for StringBuffer and concat for String. hope this helps.
antraarora
Ranch Hand

Joined: Jul 27, 2000
Posts: 45
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

Joined: Jan 28, 2004
Posts: 135
right, append we can't use for Strings and same way concat for StringBuffer.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: append AND concat