Logo 
Search:

Java Articles

Submit Article
Home » Articles » Java » Homework HelpRSS Feeds

Program to show an example of creating a String object from a StringBuffer Object

Posted By: Clyde Moreno     Category: Java     Views: 6068

A Java Program to show an example of creating a String object from a StringBuffer Object.

Code for Program to show an example of creating a String object from a StringBuffer Object in Java

publicclass JAVA_062
 {

    publicstaticvoid main(String[] args)
    {
       StringBuffer SB=new StringBuffer("Many hands make light work");

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

       String Str=SB.toString( );

       System.out.println("String : " + Str);
    }
 }
  
Share: 



Clyde Moreno
Clyde Moreno author of Program to show an example of creating a String object from a StringBuffer Object is from Dallas, United States.
 
View All Articles

Related Articles and Code:


 
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!