You are on page 1of 1

import java.io.*; class str { public static void main(String args[])throws IO Exception { System.out.

println("enter the string:); DataInputStream ds=new DataInputStream(System.in); String S1=ds.readLine(); System.out.println("entered string is "+S1); StringBuffer Sb=new String Buffer(S1); System.out.println("reversed string:"+Sb.reverse ()); } }

You might also like