StringBuilder java - what is StringBuilder in java

StringBuilder java :-

1) StringBuilder class is like same as String.

2) StringBuilder class is not thread-safe.

3) StringBuilder class is mutable sequence of characters.

4) Main method in StringBuilder class are append and insert method.

5) Through the insert method you can insert string after any index of the string.

6) There are four constructors in StringBuilder class.

    public StringBuilder()
     public StringBuilder(int capacity)
    public StringBuilder(String str)
    public StringBuilder(CharSequence seq)

Note: majaor different between StringBuilder and StringBuffer is
      StringBuffer is thread-safe and StringBuilder is not thread-safe

Comments

Recent Post

Recent Posts Widget

Popular posts from this blog

Capture image from webcam java code, examples

Use of req.query, req.params and req.body in NODE JS

How to capture finger prints in java