Frage im Vorstellungsgespräch bei BlackRock

reverse a string in Java

Antwort im Vorstellungsgespräch

Anonym

21. Sep. 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); } }