Check out example codes for "Java program to check neon number". It will help you in understanding the concepts better.

Code Example 1

import java.util.Scanner;
public class NeonNumberInJava
{
   public static void main(String[] args)
   {
      Scanner sc = new Scanner(System.in);
      System.out.println("Please enter number to check neon number or not: ");
      int number = sc.nextInt();
      int square = number * number;
      int sum = 0;
      while(square != 0)
      {
         int n = square % 10;
         sum = sum + n;
         square = square / 10;
      }
      if(sum == number)
      {
         System.out.println(number + " is a neon number.");
      }
      else
      {
         System.out.println(number + " is not a neon number.");
      }
      sc.close();
   }
}

Learn ReactJs, React Native from akashmittal.com