Here you can find the source of isLeapYear(int y)
true
if the year is a leap year
public static boolean isLeapYear(int y)
//package com.java2s; public class Main { /**//from w ww .ja va 2 s.c o m * Check if the given year is leap year. * * @return <code>true</code> if the year is a leap year */ public static boolean isLeapYear(int y) { boolean result = false; if (((y % 4) == 0) && // must be divisible by 4... ((y < 1582) || // and either before reform year... ((y % 100) != 0) || // or not a century... ((y % 400) == 0))) { // or a multiple of 400... result = true; // for leap year. } return result; } }