// create a StringBuilder object
// with a String pass as parameter
StringBuilder
str
= new StringBuilder("Hello World");
// print string
System.out.println("String = "
+ str.toString());
// get length of StringBuilder object and initialize if you use it more than ones
int length = str.length();
// you can check like
if(len != 0)
// print length
System.out.println("length of String = "
+ length);