Java examples for Language Basics:String
String Reverse
public class Main { public static void main(String args[]){ String strOriginal = "Hello World"; System.out.println("Original String : " + strOriginal); strOriginal = new StringBuffer(strOriginal).reverse().toString(); System.out.println("Reversed String : " + strOriginal); }/* ww w . j a v a 2 s . com*/ }