java中字符串的反转 public String reverse(){ String str="zhongguomeng"; char[] chars = str.toCharArray(); StringBuilder sb = new StringBuilder(); for(i=chars.length()-1;i>=0;i--){ sb.append(chars[i]); } return sb; }