本帖最后由 Noword 于 2012-7-6 04:08 编辑
//1-3月份上课天数(周三周日休假)
Calendar workDay = Calendar.getInstance();
workDay.set(2013,1,1);
int days = 0;
while(workDay.get(Calendar.MONTH) != 4)
{
if(workDay.get(Calendar.DAY_OF_WEEK) == 1 || workDay.get(Calendar.DAY_OF_WEEK) == 4)
continue;
days++;
workDay.add(Calendar.DAY_OF_MONTH, 1);
}
System.out.println("上课天数为 :"+days);
运行是停住不动了
|
|