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 {
// ww w.j  ava2 s  . com
  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.





















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