Hello ! I started programming java a while ago and I tend to do challenges that will help in my studies.
I am doing a leap year calculator and the parameter needs to be in range 1 -9999 else it will returned false though my code is incorrect.
so this is my code :
public static boolean isLeapYear(int year) { boolean result = false; if ( (year >= 1) && (year <= 9999) && (year % 400 == 0) || (year % 4 == 0) && (year % 100 != 0) ) result = true; return result; }