Logo 
Search:

Java Articles

Submit Article
Home » Articles » Java » Homework HelpRSS Feeds

Program to show insertion of StringBuffer, String objects and other Basic Data Types into a StringBuffer object

Posted By: Qadriyyah Malik     Category: Java     Views: 2980

A Java Program to show insertion of StringBuffer, String objects and other Basic Data Types into a StringBuffer object.

Code for Program to show insertion of StringBuffer, String objects and other Basic Data Types into a StringBuffer object in Java

publicclass JAVA_059
 {

    publicstaticvoid 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);
    }
 }
  
Share: 



Qadriyyah Malik
Qadriyyah Malik author of Program to show insertion of StringBuffer, String objects and other Basic Data Types into a StringBuffer object is from Lahore, Pakistan.
 
View All Articles

 
Please enter your Comment

  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].

 
No Comment Found, Be the First to post comment!