Java Leap Year Check isLeapYear(long year)

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

Description

Gets if a year is a leap year

License

Open Source License

Parameter

Parameter Description
year The year to test

Return

If a year is a leap year

Declaration

public static boolean isLeapYear(long year) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    /**//ww  w .  jav a  2 s. c  o m
     * Gets if a year is a leap year
     *
     * @param year The year to test
     * @return If a year is a leap year
     */
    public static boolean isLeapYear(long year) {
        return year % 4 == 0 && (year % 100 != 0 || year % 400 == 0);
    }
}

Related

  1. isLeapYear(int year)
  2. isLeapYear(int year)
  3. isLeapYear(int year)
  4. isLeapYear(int year)
  5. isLeapYear(Integer year)
  6. isLeapYear(long year)
  7. isLeapYear(String inputDate)
  8. leapYear(int year)
  9. leapYear(int year)