Java StringBuffer .append ( CharSequence s)

Syntax

StringBuffer.append(CharSequence s) has the following syntax.

public StringBuffer append(CharSequence s)

Example

In the following code shows how to use StringBuffer.append(CharSequence s) method.


public class Main {
//from   w w  w  . ja v  a 2s.  c  o m
  public static void main(String[] arg) {

    StringBuffer buffer = new StringBuffer();
    CharSequence cs = "java2s.com";
    buffer.append(cs);
    System.out.println(buffer);
  }

}

The code above generates the following result.





















Home »
  Java Tutorial »
    java.lang »




Boolean
Byte
Character
Class
Double
Enum
Float
Integer
Long
Math
Number
Object
Package
Process
ProcessBuilder
Runnable
Runtime
SecurityManager
Short
StackTraceElement
StrictMath
String
StringBuffer
StringBuilder
System
Thread
ThreadGroup
ThreadLocal
Throwable