You are here: Home / Topics / stringBuffer reverse () method example in Java

stringBuffer reverse () method example in Java

Filed under: Java on 2023-09-17 06:54:31

// Program to explain the following StringBuffer function :
// StringBuffer reverse()

class  Mreverse
{
public static void main( String args[ ] )
{
 StringBuffer sb = new StringBuffer( "Java Programming Examples." );

 System.out.println( " String = " + sb );
 
 sb.reverse();

 System.out.println( " String = " + sb );
}
}


Output:

String = Java Programming Examples.
String = .selpmaxE gnimmargorP avaJ

About Author:
S
Shyam Dubey     View Profile
If you are good in any field. Just share your knowledge with others.