Here you can find the source of isLeapYear(int year)
public static boolean isLeapYear(int year)
//package com.java2s; //License from project: Apache License import java.util.*; public class Main { public static boolean isLeapYear(int year) { Calendar calendar = Calendar.getInstance(); calendar.set(year, 2, 1);//w ww .ja v a 2s. c o m calendar.add(Calendar.DATE, -1); if (calendar.get(Calendar.DAY_OF_MONTH) == 29) { return true; } else { return false; } } }