Java check whether the year is a leap year

www.l‮ttua‬uri.com
Java check whether the year is a leap year
public static boolean isLeapYear(int year) {
  if (year % 4 != 0) {
    return false;
  } else if (year % 400 == 0) {
    return true;
  } else if (year % 100 == 0) {
    return false;
  } else {
    return true;
  }
}
Created Time:2017-09-25 23:39:52  Author:lautturi