[用户必须输入日期,然后我必须显示给定日期之间的星期范围,对于此实例,范围应为
开课日期:2016年1月10日星期日,截止日期:2016年1月16日星期六] 1
public static void main(String[] args) {
Calendar c = Calendar.getInstance();
//get the day from the user
//c.set(Calendar.DAY_OF_WEEK, Calendar.MONDAY); //I want to set the date here
//The range of the given day
System.out.print("Start Date : " + c.getTime() + ", ");
c.add(Calendar.DAY_OF_WEEK, 6);
System.out.println("End Date : " + c.getTime());
c.add(Calendar.DAY_OF_WEEK, 1);
}