Java Blog

 
 
 
 public class JAVA_059
 {

    public static void main(String[] args)
    {
       StringBuffer SB=new StringBuffer(\"Many hands make light work\");

       System.out.println(\"StringBuffer : \" + SB);

       SB.insert(4,\" old\");

       System.out.println(\"StringBuffer : \" + SB);

       char[] cArray={\'i\',\'s\',\' \',\'e\',\'x\',\'a\',\'c\',\'t\',\'l\',\'y\',\' \'};

       SB.insert(0,cArray,3,8);

       System.out.println(\"StringBuffer : \" + SB);

       StringBuffer Temp=new StringBuffer(\"??? \");

       SB.insert(8,Temp);

       System.out.println(\"StringBuffer : \" + SB);
    }
 }