字符串反转 1.利用StringBuffer String str="hello world!"; StringBuilder sb=new StringBuilder(str); String s = sb.reverse().toString(); 2.数组