Here you can find the source of getNumberOfDaysInMonthes(int theyear)
private static int[] getNumberOfDaysInMonthes(int theyear)
//package com.java2s; //License from project: Open Source License public class Main { private static int[] getNumberOfDaysInMonthes(int theyear) { return new int[] { 31, getLeapYear(theyear), 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; }/* w w w . j av a 2s .c om*/ private static int getLeapYear(int theyear) { return ((theyear % 4 == 0 && theyear % 100 != 0) || theyear % 400 == 0) ? 29 : 28; } }