A mutable sequence of characters. This class provides an API compatible with StringBuffer, but with no guarantee of synchronization. This class is designed for use as a drop-in replacement for StringBuffer in places where the string buffer was being used by a single thread (as is generally the case). Where possible, it is recommended that this class be used in preference to StringBuffer as it will be faster under most implementations. 可能最大的区别是关于同步的问题,也就是线程安全的问题吧,前者不同步,后者同步,所以前者相对来说效率应该更高一点
可能最大的区别是关于同步的问题,也就是线程安全的问题吧,前者不同步,后者同步,所以前者相对来说效率应该更高一点
而 StringBuffer 是可变长的。我的BLOG有更详细的:http://blog.csdn.net/jeader
手头没有源代码,
以前大致流览过一点,好像 StringBuffer 把有关于空间申请更新等操作的放到StringBuilder
不想装 1.5了