Here you can find the source of isLeapYear(int year)
Verify if a given year is leap.
Parameter | Description |
---|---|
year | Year. |
public static final boolean isLeapYear(int year)
//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; } }