Thursday, 26 May 2011

Reversing a string in java

import java.util.*;
public class ReverseString{

public static void main(String args[])
{
    StringBuffer s=new StringBuffer("Java is interesting");
    System.out.println("Before reversing the string :"+s);
    s=s.reverse();
    System.out.println("After Reverse string is :"+s);




}
}

No comments: