public final class StringBuffer
extends AbstractStringBuilder
implements java.io.Serializable, CharSequence
{
private synchronized void writeObject(java.io.ObjectOutputStream s)
throws java.io.IOException {java.io.ObjectOutputStream.PutField fields = s.putFields();
fields.put("value", value);
fields.put("count", count);
fields.put("shared", false);
s.writeFields();
}
/**
* readObject is called to restore the state of the StringBuffer from
* a stream.
*/
private void readObject(java.io.ObjectInputStream s)
throws java.io.IOException, ClassNotFoundException {
java.io.ObjectInputStream.GetField fields = s.readFields();
value = (char[])fields.get("value", null);
count = fields.get("count", 0);
}
}
其余的方法都是继承了它的父类,并且方法是public synchronized +返回值类型+方法名