Here you can find the source of getNextWeekDay(Date startDate, int day)
public static Date getNextWeekDay(Date startDate, int day)
//package com.java2s; //License from project: Apache License import java.util.Calendar; import java.util.Date; public class Main { public static Date getNextWeekDay(Date startDate, int day) { Calendar strDate = Calendar.getInstance(); strDate.setFirstDayOfWeek(Calendar.MONDAY); strDate.setTime(startDate);/* w w w .j a v a 2 s . c o m*/ strDate.add(Calendar.WEEK_OF_YEAR, 1); strDate.set(Calendar.DAY_OF_WEEK, day); return strDate.getTime(); } }