Here you can find the source of getMonthDays(Object year, Object month)
public static int getMonthDays(Object year, Object month)
//package com.java2s; //License from project: Open Source License import java.util.Calendar; public class Main { public static int getMonthDays(Object year, Object month) { Calendar cal = Calendar.getInstance(); cal.set(Calendar.YEAR, Integer.parseInt(year.toString())); cal.set(Calendar.MONTH, Integer.parseInt((month.toString())) - 1); return cal.getActualMaximum(Calendar.DAY_OF_MONTH); }/*from w w w . j a va 2s.c o m*/ }