public boolean isPalindrome(int x) {
		if (x < 0) {
			return false;
		}
		String s = String.valueOf(x);
		if (s.length() == 1) {
			return true;
		}
		char[] allDigits = s.toCharArray();
		int begin;
		int end;
		if (s.length() % 2 == 0) {
			begin = s.length() / 2 - 1;
			end = s.length() / 2;
		} else {
			begin = s.length() / 2;
			end = begin;
		}
		while (begin >= 0 && end < s.length()
				&& allDigits[begin] == allDigits[end]) {
			begin--;
			end++;
		}
		if (begin == -1 && end == s.length()) {
			return true;
		} else {
			return false;
		}
	}