Opening Hours :7AM to 9PM
class AutomorphicNumber { public boolean isAutomorphic(int n) { // compute the square of the number int square = n * n; // check if the last digits of the square and the original number are the same while (n > 0) { if (n % 10 != square % 10) { return false; } n /= 10; square /= 10; } return true; } } public class Main { public static void main(String[] args) { AutomorphicNumber a=new AutomorphicNumber(); int n = 25; System.out.println(n + " is" + (a.isAutomorphic(n) ? "" : " not") + " an automorphic number."); } }This program defines a method isAutomorphic that takes an integer n as input and returns true if n is an automorphic number, and false otherwise. To use this program, you can compile and run it, and it will print whether the number 25 is an automorphic number. You can modify the value of n in the main method to check if other numbers are automorphic.