1StringBuilder stringBuilder = new StringBuilder();
2
3stringBuilder.append("string");
4
5System.out.println("String = " + stringBuilder.toString());
1Java StringBuilder class is used to create
2 mutable (modifiable) string. The Java
3 StringBuilder class is same as StringBuffer
4 class except that it is non-synchronized.
5
6StringBuilder()
7 creates an empty string Builder with the initial capacity of 16.
8StringBuilder(String str)
9 creates a string Builder with the specified string.
10StringBuilder(int length)
11 creates an empty string Builder with the specified capacity as length.