Java Data Type Tutorial - Java StringBuilder .append ( CharSequence s)








Syntax

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

public StringBuilder append(CharSequence s)

Example

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

public class Main {
/*from  w  w w  . j a  va2 s .  c o  m*/
  public static void main(String[] arg) {

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

}

The code above generates the following result.