Java Data Type Tutorial - Java StringBuilder(CharSequence seq) Constructor








Syntax

StringBuilder(CharSequence seq) constructor from StringBuilder has the following syntax.

public StringBuilder(CharSequence seq)

Example

In the following code shows how to use StringBuilder.StringBuilder(CharSequence seq) constructor.

public class Main {
/*from ww  w  . j  ava2 s  .co  m*/
  public static void main(String[] arg) {

    CharSequence phrase = "abced";
    StringBuilder buffer = new StringBuilder(phrase);

    System.out.println(buffer);
  }

}

The code above generates the following result.