Created
August 1, 2019 10:07
-
-
Save 0ryant/d624b8d0e68a3e1de0333a41bfd96bdc to your computer and use it in GitHub Desktop.
Java - Coding Challenge 4 - LeapYear
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class LeapYear { | |
public static boolean isLeapYear(int year) { | |
if (year < 1 || year > 9999) { | |
return false; | |
} | |
if (year % 4 == 0) { | |
if (year % 100 == 0) { | |
if (year % 400 == 0) { | |
return true; | |
} | |
return false; | |
} | |
return true; | |
} | |
return false; | |
} | |
} |
ilialloyd
commented
Aug 30, 2022
•
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment