Java Leap Year Check isLeapYear(int year)

Here you can find the source of isLeapYear(int year)

Description

Verify if a given year is leap.

License

Open Source License

Parameter

Parameter Description
year Year.

Return

Leap or not.

Declaration

public static final boolean isLeapYear(int year) 

Method Source Code

//package com.java2s;

public class Main {
    /**//from w ww. j a  va2 s.c o m
     * <p>
     * Verify if a given year is leap.
     * </p>
     * @param year Year.
     * @return Leap or not.
     */
    public static final boolean isLeapYear(int year) {
        if (year % 4 == 0) {
            return year % 100 != 0 ? true : year % 400 == 0;
        }
        //
        return false;
    }
}

Related

  1. isLeapYear(int prolepticYear)
  2. isLeapYear(int y)
  3. isLeapYear(int y)
  4. isLeapYear(int year)
  5. isLeapYear(int year)
  6. isLeapYear(int year)
  7. isLeapYear(int year)
  8. isLeapYear(int year)
  9. isLeapYear(int year)