Here you can find the source of getMonthDaysArray(int year)
public static int[] getMonthDaysArray(int year)
//package com.java2s; public class Main { public static int[] getMonthDaysArray(int year) { int[] a1 = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; int[] a2 = { 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; if (year <= 1582) { if ((year % 4) == 0) { if (year == 4) { return a1; }//from ww w . j a va 2s. co m return a2; } } else { if (((year % 4) == 0) && ((year % 100) != 0)) { return a2; } else if ((year % 400) == 0) { return a2; } } return a1; } }