isLeapYear static method

bool isLeapYear(
  1. int y
)

Implementation

static bool isLeapYear(int y) {
  return (y % 4 == 0 && y % 100 != 0) || (y % 400 == 0);
}