Logo 
Search:

Java Articles

Submit Article
Home » Articles » Java » Homework HelpRSS Feeds

Program to change characters in a StringBuffer objects and to reverse its contents

Posted By: Jonah Brown     Category: Java     Views: 3426

A Java Program to change characters in a StringBuffer objects and to reverse its contents.

Code for Program to change characters in a StringBuffer objects and to reverse its contents in Java

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

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

       SB.setCharAt(4,'%');
       SB.setCharAt(10,'%');
       SB.setCharAt(15,'%');
       SB.setCharAt(21,'%');

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

       SB.reverse( );

       System.out.println("After Reversing, StringBuffer : " + SB);
    }
 }
  
Share: 



Jonah Brown
Jonah Brown author of Program to change characters in a StringBuffer objects and to reverse its contents is from Melbourne, Australia.
 
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!