Java Basics
Java Object Oriented
Java Advanced
Java Useful References
Java Useful Resources
Selected Reading
© 2011 TutorialsPoint.COM
|
Java - String Buffer reverse() Method
Description:
This method reverses the value of the StringBuffer object that invoked the method.
Let n be the length of the old character sequence, the one contained in the string buffer just prior to execution of the reverse method. Then the character at index k in the new character sequence is equal to the character at index n-k-1 in the old character sequence.
Syntax:
Here is the syntax for this method:
public StringBuffer reverse()
|
Parameters:
Here is the detail of parameters:
Return Value :
Example:
public class Test{
public static void main(String args[]){
StringBuffer buffer = new String( " Game Plan");
buffer.reverse();
System.out.println(buffer);
}
}
|
This produces following result:
|
|
|