String Reverse in Java Example

String Reverse Java Program:

package in.javadomain;

public class stringReverse {
	public static void main(String[] args) {
		String input = "DOG";
		System.out.println("Original String :::" + input);
		StringBuffer reverseInput = new StringBuffer(input).reverse();
		System.out.println("Reversed String :::" + reverseInput);
	}
}

Output:

Original String :::DOG
Reversed String :::GOD

621 total views, 3 views today

About: Mirthbees

Blogger, Innovator, Developer and Enterpreneur. Founder of GuruRecharge, Readymade online recharge script. Lead Developer in Bookrate.in