Opening Hours :7AM to 9PM
class SunnyNumber { public boolean isSunny(int n) { int sum = 0; while (n > 0) { int digit = n % 10; sum += digit * digit; n /= 10; } return sum == n; } } public class Main { public static void main(String[] args) { SunnyNumber sn=new SunnyNumber(); int n = 19; System.out.println(n + " is" + (sn.isSunny(n) ? "" : " not") + " a sunny number."); } }This program defines a method isSunny that takes an integer n as input and returns true if n is a sunny number, and false otherwise.