Hi,
I have got a doubt In String. String objects are Immutable and StringBulider/StringBuffer objects are mutable. Almost we can do all the String functionality in StringBulider. Then why we need to use String instead of String builder/StringBuffer. Is there any specific reason available for using String? kindly clarify my doubt.
sasikrishnasamy
0
Newbie Poster
Recommended Answers
Jump to PostStrings are supported as a special case in the compiler and are very highly optimised. The fact that they are immutable allows all kinds of optimisations that are not possible for mutable objects, especially in a multi-threaded environment.
All 3 Replies
JamesCherrill
4,733
Most Valuable Poster
Team Colleague
Featured Poster
milil
24
Newbie Poster
jwenting
1,889
duckman
Team Colleague
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.