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);

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

1,031 total views, 1 views today

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.