Using StringBuffer to Reverse String in Java

November 29, 2012

import java.util.Scanner; public class Reverse { public static void main(String[] args) { Scanner input = new Scanner(System.in); System.out.print(“ENTER STRING: “); StringBuffer reverse = new StringBuffer(input.nextLine()).reverse(); System.out.println(“REVERSED: ” +reverse); } }

Read More >>