300+ free video programming tutorials ― Learn for free!
Category: Java - Author: Karl Hadwen
Did you find this video helpful? If so, why not subscribe!? ? http://bit.ly/CognitiveSurge
In this video I'll be showing you the difference between String and StringBuffer. To quote a good Stackoverflow source:
String is used to manipulate character strings that cannot be changed (read-only and immutable).
StringBuffer is used to represent characters that can be modified.
Performance wise, StringBuffer is faster when performing concatenations. This is because when you concatenate a String, you are creating a new object (internally) every time since String is immutable.
Like the Cognitive Surge Facebook page
Follow me on Twitter (Feel free to tweet me questions!)