Complete the code to create a new StringBuilder object.
StringBuilder sb = new [1]();The StringBuilder class is used to create mutable strings in Java. The code creates a new StringBuilder object.
Complete the code to append text to a StringBuilder.
sb.[1]("Hello");
add which does not exist for StringBuilder.concat which is a String method, not StringBuilder.The append method adds text to the end of the current StringBuilder content.
Fix the error in converting StringBuilder to String.
String result = sb.[1]();toStr or stringify.The toString() method converts the StringBuilder content to a String.
Fill both blanks to create a StringBuilder and append text.
StringBuilder [1] = new [2](); [1].append("World");
String instead of StringBuilder for the object.The variable name sb is commonly used for StringBuilder objects. The class name must be StringBuilder to create the object.
Fill all three blanks to build a string and convert it to String.
StringBuilder [1] = new [2](); [1].append("Hi"); String [3] = [1].toString();
StringBuffer which is similar but different class.The variable builder is used for the StringBuilder object. The class name is StringBuilder. The final String variable is named text to hold the converted string.
