// Java code to illustrate
// methods of StringBuilder
importjava.util.*;importjava.util.concurrent.LinkedBlockingQueue;publicclassGFG1{publicstaticvoidmain(String[]argv)throwsException{// create a StringBuilder object
// with a String pass as parameter
StringBuilderstr=newStringBuilder("AAAABBBCCCC");// print string
System.out.println("String = "+str.toString());// reverse the string
StringBuilderreverseStr=str.reverse();// print string
System.out.println("Reverse String = "+reverseStr.toString());// Append ', '(44) to the String
str.appendCodePoint(44);// Print the modified String
System.out.println("Modified StringBuilder = "+str);// get capacity
intcapacity=str.capacity();// print the result
System.out.println("StringBuilder = "+str);System.out.println("Capacity of StringBuilder = "+capacity);}}