This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes String & StringBuffer -- Difference Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Reply locked New topic

String & StringBuffer -- Difference

Makesh Sundaresan

Joined: Nov 08, 2003
Posts: 4
what is the difference between String & StringBuffer ?
Advance Thanx.
Jessica Sant

Joined: Oct 17, 2001
Posts: 4313

In a nutshell -- Strings are immutable (cannot be changed once they are created) whereas StringBuffers are mutable(can be changed and manipulated after they are created).
Check out the API for String and StringBuffer for more detail about each of the classes.

Closing this duplicate -- please reply in the original thread here.
[ November 09, 2003: Message edited by: Jessica Sant ]

- Jess
Blog:KnitClimbJava | Twitter: jsant | Ravelry: wingedsheep
I agree. Here's the link:
subject: String & StringBuffer -- Difference