Question: Write the methods with the following headers: // Return the reversal of an integer, e.g., reverse(456) returns 654 public static int reverse(int number) // Return
Write the methods with the following headers:
// Return the reversal of an integer, e.g., reverse(456) returns 654
public static int reverse(int number)
// Return true if number is a palindrome
public static boolean isPalindrome(int number)
Use the reverse method to implement isPalindrome. A number is a palindrome if its reversal is the same as itself. Write a test program that prompts the user to enter an integer and reports whether the integer is a palindrome.
Step by Step Solution
3.50 Rating (157 Votes )
There are 3 Steps involved in it
import javautilScanner public class Exercise0603 public static void mainString args Scanner input ne... View full answer
Get step-by-step solutions from verified subject matter experts
