Friday, August 2, 2013

Exercise 16

import java.io.*;
public class Reverse {

   
    public static void main(String[] args)throws Exception
    {
        BufferedReader fb=new BufferedReader(new InputStreamReader(System.in));
        System.out.print("enter string");
        String name=fb.readLine();
      
        String reverse=new StringBuffer(name).reverse().toString();
      
        System.out.print("the reverse string is:"+reverse);

    }

}

No comments:

Post a Comment