如题。

解决方案 »

  1.   

    static boolean huihuan(int x, String str){
       if (str.charAt(x) != str.charAt(str.length()-x-1))
       return false; 
       if (x == str.length()/2)
       return true;
       return huihuan(x+1, str);
    }调用的时候x要给0。如
    if (huihuan(0,"123321"))
    System.out.println("yes");
      

  2.   

    public boolean test(String str) {
    if (str.length() <= 1) return true;
    if (("" +str.charAt(0)).equals("" + str.charAt(str.length() - 1))) ;
    String ss = str.substring(1, str.length() - 1);
    test(ss);
    return true;
    }你要记得给分啊
      

  3.   

    public boolean test(String str) {
    if (str.length() <= 1) return true;
    if (str.charAt(0) == str.charAt(str.length() - 1)) { 
    String ss = str.substring(1, str.length() - 1);
    test(ss); 
    return true;
    }
    return false;
    }改进了一下。把char给忘了。
    晕。。