Here you can find the source of daysOfMonth(int year)
private static int[] daysOfMonth(int year)
//package com.java2s; //License from project: Open Source License public class Main { private static final int[] DAYS_OF_MONTH_IN_NORMAL_YEAR = new int[] { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };// w w w. j av a 2s . c o m private static final int[] DAYS_OF_MONTH_IN_LEAP_YEAR = new int[] { 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; private static int[] daysOfMonth(int year) { if (isLeapYear(year)) { return DAYS_OF_MONTH_IN_LEAP_YEAR; } return DAYS_OF_MONTH_IN_NORMAL_YEAR; } private static boolean isLeapYear(int year) { if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) { return true; } return false; } }