DEV Community

Cover image for STRING BUILDER IN JAVA
Vinoth Kumar
Vinoth Kumar

Posted on Edited on

STRING BUILDER IN JAVA

STRING BUILDER :

A mutable sequence of characters introduced in Java 1.5. It is not thread-safe, which makes it faster and suitable for single-threaded environments.

EXAMPLE :

class StringBuilder{
    public static void main(String[] args) {
        StringBuilder sb = new StringBuilder("Hello");
        sb.append(" World");
        System.out.println(sb);
    }
}
Enter fullscreen mode Exit fullscreen mode

Top comments (0)