```
public boolean isPalindrome(int x) {
if(x<0){
return false;
}
if(0<=x && x<=9){
return true;
}
x=Math.abs(x);
int cp =x;
int count=-1;
while(cp>0){
cp=cp/10;
count++;
}
int a=x;
int b=x;
while(a>0 && b>0){
int temp1=(int)(a/Math.pow(10, count));
a=a-temp1*(int)(Math.pow(10, count));
count--;
int temp2=b%10;
b=b/10;
if(temp1!=temp2){
return false;
}
}
return true;
}
```