BlackRock interview question

reverse a string in Java

Interview Answer

Anonymous

21 Sept 2014

public class Reverse { public static void main(String[] args) { String str = “Reverse this string, please”; StringBuilder sb = new StringBuilder(str); sb.reverse(); System.out.println(sb); } }