String reverse in JAVA programming


package SolveProblem;

public class StringReverse {

    public static void main(String[] args) {
        String name="Alamgir Hossain";
       
        name=new StringBuffer(name).reverse().toString();
       
        System.out.println("Reverse string is : "+name);
    }

}
//---------------------------output--------------------------------------
//niassoH rigmalA

No comments:

Post a Comment