Following are the various constructors provided by the StringBuilder class.
S.N. | Constructor & Description |
---|---|
1 | StringBuilder() This constructs a string builder with no characters in it and an initial capacity of 16 characters. |
2 | StringBuilder(CharSequence seq) This constructs a string builder that contains the same characters as the specified CharSequence. |
3 | StringBuilder(int capacity) This constructs a string builder with no characters in it and an initial capacity specified by the capacity argument. |
4 | StringBuilder(String str) This constructs a string builder initialized to the contents of the specified string. |