Name

java.lang.StringBuffer

Synopsis

This class is a scaled-down version of the J2SE StringBuffer class. It creates an editable concatenation of characters. Use the append() and insert() methods to add characters to the middle or end of the StringBuffer. Utilize the capacity() and ensureCapacity() methods to ensure that the size requirements of the buffer are sufficient. The delete() and deleteCharAt() methods can be used to remove portions of the buffer. The reverse() method will replace the current string with a backward copy of itself.

public final classStringBuffer {
   // public constructors
   public StringBuffer();
   public StringBuffer(int length);
   public StringBuffer(String str);

   // public instance methods
   public StringBuffer append(boolean b);
   public synchronized StringBuffer append(char c);
   public synchronized StringBuffer append(char[] str);
   public synchronized StringBuffer append(char[] str, int offset, int len);
   public StringBuffer append(int i);
   public StringBuffer append(long l);
   public synchronized StringBuffer append(Object obj);
   public synchronized StringBuffer append(String str);
   public int capacity();
   public synchronized char charAt(int index);
   public synchronized StringBuffer delete(int start, int end);
   public synchronized StringBuffer deleteCharAt(int index);
   public synchronized void ensureCapacity(int minimumCapacity);
   public synchronized void getChars(int srcBegin, int srcEnd,
      char[] dst, int dstBegin);
   public StringBuffer insert(int offset, boolean b); public synchronized ...

Get Wireless Java now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.