Respuesta :

tonb

Will this help you? Not sure if you ask that your program can take multiple numbers and test each for palindrome, but surely you will need a function like below:


public static boolean isPalindrome(int n) {

String s = Integer.toString(n);

for(int i=0; i<s.length()/2; i++) {

if (s.charAt(i) != s.charAt(s.length()-i-1)) {

return false;

}

}

return true;

}

ACCESS MORE
EDU ACCESS
Universidad de Mexico