Here you can find the source of getLastDayOfYear(int year)
public static Date getLastDayOfYear(int year)
//package com.java2s; import java.util.Calendar; import java.util.Date; public class Main { public static Date getLastDayOfYear(int year) { return getEndDate(Calendar.DECEMBER, year); }//from w ww .j a v a2 s. c om public static Date getEndDate(int month, int year) { Calendar calendar = Calendar.getInstance(); calendar.set(Calendar.MONTH, month); calendar.set(Calendar.YEAR, year); calendar.set(Calendar.DATE, calendar.getActualMaximum(Calendar.DATE)); return calendar.getTime(); } }