Here you can find the source of getLastDayOfWeek(int year, int week)
public static Date getLastDayOfWeek(int year, int week)
//package com.java2s; import java.util.Calendar; import java.util.Date; public class Main { public static Date getLastDayOfWeek(int year, int week) { Calendar cal = Calendar.getInstance(); cal.set(Calendar.YEAR, year); cal.set(Calendar.MONTH, Calendar.JANUARY); cal.set(Calendar.DATE, 1); Calendar c = (Calendar) cal.clone(); c.add(Calendar.DATE, week * 7); return getEndTimeOfWeek(c.getTime()); }/*from w ww . ja v a2 s . c o m*/ private static Date add(Date date, int field, int amount) { Calendar cal = Calendar.getInstance(); cal.setTime(date); cal.add(field, amount); return cal.getTime(); } public static Date getEndTimeOfWeek(Date date) { Calendar cal = Calendar.getInstance(); cal.setFirstDayOfWeek(Calendar.MONDAY); cal.setTime(date); cal.set(Calendar.DAY_OF_WEEK, Calendar.MONDAY + 6); cal.set(Calendar.HOUR_OF_DAY, 23); cal.set(Calendar.MINUTE, 59); cal.set(Calendar.SECOND, 59); return cal.getTime(); } }