3 ms·
It seems bizarre that there are a lot of equivalent classes that are thread safe or not with names that are simply synonymous. Is it just me?
by esrauch 14y ago
It seems bizarre that there are a lot of equivalent classes that are thread safe or not with names that are simply synonymous. Is it just me?
- spacemanaki 14y agoIt seems bizarre, but it's just because they were part of different versions. StringBuffer was in Java 1.0, and StringBuilder was added in Java 1.5. If they were both part of the original Java libraries they would hopefully have been given better names. I suppose they could have called StringBuilder "UnSynchronizedStringBuffer" or "NotThreadSafeStringBuffer", but those are problematic on their own. You have the same problems with Vector and ArrayList I guess, although since ArrayList was added as part of the collections libraries it makes a bit more sense.