String str = "Hello"; String reverse(String str){ StringBuilder sb = new StringBuilder(); sb.append(str); sb.reverse(); return sb.toString(); }