今天想起了之前的一个问题,反写字符串的方法。
public class shouxie {
    public static void main(String[] args) {
        String str = "abcdefghijklmnopqrstuvwxyz";
        int length = str.length();
        char[] chars =  str.toCharArray();
        for(int i = 0 ; i < length / 2 ; i ++){
            char temp;
            temp = chars[i];
            chars[i] = chars[length - 1 -i];
            chars[length -1 - i] = temp;
        }
        System.out.println(chars);
    }
}
这样就可以了。原文:http://www.cnblogs.com/April-Chou-HelloWorld/p/6526953.html