public static boolean f(byte[] x, int a, int b) {
    if (a < b) {
      if (x[a] != x[b]) {
        return false;
      }
      return f(x, ++a, --b);
    }
    return true;
  }test:
  String s = "abcba";
  if (f(s.getBytes(), 0, s.length() - 1)) {
      System.out.println("yes");
  }不支持中文