In this article, we will see how to use StringBuilder class in Java.
The StringBuilder in Java provides a modifiable sequence of char acters. The String Class in Java creates and immutable sequence of char acters, the StringBuilder class provides an alternate to String Class, as it creates a mutable sequence of char acters.
The Java StringBuilder class is same to StringBuffer class, except it is non-synchronized.
Lets look to our code.
StringBuilder x = new StringBuilder();
Lets see it in an example.
In above example, we created a StringBuilder object. We used its few methods to do various operation on the String we store in it.