2.StringBuffer StringBuffer:String类同等的类,它允许字符串改变(原因见上一段所说).Overall, this avoids creating many temporary (临时)strings, in other words, without StringBuffer, you must create many temporary strings. StringBuffer的内部实现原理:马克-to-win,Every string buffer(缓存)…
在java中我们经常可以看到StringBuffer和String的用法,但是我自己在使用过程中,经常会将两者弄混淆,今天我们就来了解一下两者的区别: 我们首先来看一下我们的官方API中的简单介绍: A string buffer is like a String, but can be modified. At any point in time it contains some particular sequence of characters, but the length and con…