Skip to content

Instantly share code, notes, and snippets.

View vlymar's full-sized avatar

Victor Lymar vlymar

View GitHub Profile
@vlymar
vlymar / gist:1726840
Created February 3, 2012 01:00
isLeapYear
/** Checks whether the given year is a leap year.
* @return true if and only if the input year is a leap year.
*/
public static boolean isLeapYear(int year) {
if(year % 400 == 0) {
return true;
} else if(year % 100 == 0) {
return false;
} else if(year % 4 == 0) {
return true;