Here you can find the source of isLeapYear(int year)
Parameter | Description |
---|---|
year | the four-digit year. |
public static boolean isLeapYear(int year)
//package com.java2s; /*/*from w w w . jav a2 s . c om*/ * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ public class Main { /** * return the leap year for years 1581-8999. * @param year the four-digit year. * @return true if the year is a leap year. */ public static boolean isLeapYear(int year) { if (year < 1000) throw new IllegalArgumentException("year must be four-digits"); return (year % 4) == 0 && (year % 100 != 0 || year % 400 == 0); } }