Because String and StringBuilder (or StringBuffer) are designed for different purposes, I can understand the reasons for half of the difference (such as String does not have append and delete). However, there are a few points still confusing me.
To name a few:
- String has both
getBytesandgetCharsbut StringBuilder has onlygetChars. - String and StringBuilder have
replaceof different functionality respectively. - String has
toLowerCaseandtoUpperCase, whereas StringBuilder does not. - String has
trim, whereas StringBuilder does not.
I know they are by design, but why?
getBytesin theStringBuilder).