Code Below:
import java.util.*;
class AdamNo
{
int reverse(int n) //indentifier(int) should be there even in parameter
{
int a,rev=0,dup=n;
while (dup>0)
{
a=dup%10;
rev=rev*10+a;
dup=dup/10;
}
return rev;
}
public static void main()
{
AdamNo obj=new AdamNo();
Scanner s=new Scanner(System.in);
System.out.println("Enter a no.");
int n=s.nextInt();
int r=obj.reverse(n);
if ((n*n)==obj.reverse(r*r))
System.out.println(n+" is Adam No.");
else
System.out.println(n+" is not Adam No.");
}
}