
- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Constructors of StringBuilder class in Java.
The StringBuilder class of the java.lang package is a mutable sequence of characters. This provides an API compatible with StringBuffer, but with no guarantee of synchronization. Following are the list of 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. |
- Related Questions & Answers
- Java StringBuilder class.
- Methods of StringBuilder class in Java.
- Constructors of StringBuffer class in Java.
- Constructors of StringTokenizer class in Java.
- Can an anonymous class have constructors in Java?
- Type of Java constructors
- Constructors in Java
- What is the purpose of the StringBuilder class in C#?
- Get all Constructors in Java
- What are constructors in Java?
- Remove substring from StringBuilder in Java
- Converting String to StringBuilder in Java
- Can interfaces have constructors in Java?
- Can constructors be inherited in Java?
- What are Default Constructors in Java?
Advertisements