StringBuffer reverse()


reverse()

You can reverse the characters within a StringBuffer object using reverse(), shown here :

StringBuffer reverse()

This method reverses the object he was told to reverse. The following program displays the reverse ():

Example

Program
public class Main 
{
  public static void main(String[] args) 
  {
    StringBuffer sb = new StringBuffer("guriasoft");
    System.out.println("Before reverse = " + sb);
    StringBuffer rev = sb.reverse();
    System.out.println("After reverse = " + rev);
  }
}