Here you can find the source of getMonthDay(int year, int month)
public static int getMonthDay(int year, int month)
//package com.java2s; //License from project: Apache License public class Main { public static int getMonthDay(int year, int month) { return getMonthDayByYear(year)[(--month)]; }/* ww w . jav a 2s . co m*/ public static int[] getMonthDayByYear(int year) { int[] monthDay = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; if (((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0)) monthDay[1] += 1; return monthDay; } }