package com.cocurrent.aqs;
/**
* @Author : WeiYaBo
* @Description :
* @Date : Created in 17:42 2019/10/15
* @Modified By:
*/
public class Palindrome {
public static void main(String[] args) {
int a = 52325;
String c = String.valueOf(a);
boolean d = isPalindrome(c);
System.out.println("是否为回文" + d);
}
public static boolean isPalindrome(String str) {
if (str == null || "".equals(str)) {
return false;
}
int i;
int j = str.length() - 1;
String[] strings = str.split("");
for (i = 0; i <= j; i++, j--) {
if (!strings[i].equals(strings[j])) {
return false;
}
}
return true;
}
}