Java StringBuffer reverse Example

StringBuffer class reverse method example. This example shows you how to use reverse method.


StringBuffer class reverse method example. This example shows you how to use reverse method.reverse method causes this character sequence to be replaced by the reverse of the sequence. If there are any surrogate pairs included in the sequence, these are treated as single characters for the reverse operation.

Here is the code
/**
 * @(#) Reverse. java
 * A class representing reverse method
 * @Version  01-May-2008
 @author   Rose India Team
 */

public class Reverse {
  public static void main(String args[]) {
    StringBuffer sb = new StringBuffer("Rose india");

  //Reverse characters of the buffer and display the buffer
  System.out.println(sb.reverse());
  }
}

null

Post Comment
Name:
E-mail:
Contact no :
Comments:
  Refresh Image
Verify Image:
 
 
Your Comment's
 
 
 

HOME | COPYRIGHT | CONTACT US