Java String(StringBuilder builder) Constructor
Syntax
String(StringBuilder builder) constructor from String has the following syntax.
public String(StringBuilder builder)
Example
In the following code shows how to use String.String(StringBuilder builder) constructor.
//from ww w . j av a2s . c om
public class Main {
public static void main(String[] argv) {
StringBuilder sb = new StringBuilder();
sb.append("java2s.com");
System.out.println(new String(sb));
}
}
The code above generates the following result.