Zensar Technologies Interview Question

Write a code to reverse a string

Interview Answer

Anonymous

Oct 4, 2017

//reverese the string public static void getReverseString(String text) { String reverseString = ""; int length = text.length(); while (length != 0) { System.out.print(text.charAt(length - 1)); length--; } }