Here you can find the source of getLastDayOfMonth(Calendar calendar)
public static Calendar getLastDayOfMonth(Calendar calendar)
//package com.java2s; //License from project: LGPL import java.util.Calendar; public class Main { public static Calendar getLastDayOfMonth(Calendar calendar) { Calendar ret = (Calendar) calendar.clone(); ret.add(Calendar.MONTH, 1); ret.set(Calendar.DAY_OF_MONTH, 0); return ret; }//w ww. j a va 2 s .c o m }