Here you can find the source of isLeapYear(int year)
Parameter | Description |
---|---|
year | Year value |
public static boolean isLeapYear(int year)
//package com.java2s; //License from project: Apache License public class Main { /**//from ww w .j ava 2s . c om * Cheks is leap year or not * * @param year Year value * @return True if leap year, false otherwise */ public static boolean isLeapYear(int year) { if (year < 1582) { if (year % 4 == 0) return true; } if (year % 100 == 0 && (year / 100) % 4 != 0) return false; if (year % 4 == 0) return true; return false; } }