Here you can find the source of lastDayOfMonth(Calendar c)
public static synchronized int lastDayOfMonth(Calendar c)
//package com.java2s; import java.util.Calendar; public class Main { public static synchronized int lastDayOfMonth(Calendar c) { // final int[] daysPerMonth = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, // 30, 31}; // int month = c.get(Calendar.MONTH); // return daysPerMonth[month]; return c.getActualMaximum(Calendar.DATE); }/*w ww.j a va2s . c om*/ }