Java examples for Language Basics:StringBuffer
How to reverse the content of the StringBuffer using reverse method of Java StringBuffer class.
public class Main { public static void main(String[] args) { StringBuffer sb = new StringBuffer("Java StringBuffer Reverse Example"); System.out.println("Original StringBuffer Content : " + sb); // w ww . j av a 2 s. co m //To reverse the content of the StringBuffer use reverse method sb.reverse(); System.out.println("Reversed StringBuffer Content : " + sb); } }