public boolean isGregorianLeapYear(int year) { // Every year that is exactly divisible by four is a leap year if ((year%4)==0) { // except for years that are exactly divisible by 100. if ((year%100)==0) { // the centurial years that are exactly divisible by 400 are still leap years. if ((year%400)==0) { return true; } else { return false; } } else { return true; } } else { return false; } }