public static boolean isPalindrome(long n) {
    
        String s = Long.toString(n);
        for (int i = 0; i < s.length() / 2 + 1; ++i)
            if (s.charAt(i) != s.charAt(s.length() - 1 - i))
                return false;
       return true;
    
    }