String reverse pgm
package com.demo;
public class StringRev {
public static void main(String[] args) {
String name = "namratha";
System.out.println("before rev "+name);
String reverse = new StringBuffer(name).reverse().toString();
System.out.println("rev "+reverse);
}
}
No comments:
Post a Comment