java中如何求出2008年的第1星期星期一是几号?
题目8: 2008年的第1星期星期一是几号?
import java.util.*;
public class Test {
public static void main(String[] args) {
Date date;
Calendar cal=Calendar.getInstance();
cal.set(Calendar.YEAR, 2008);
cal.set(Calendar.WEEK_OF_YEAR, 1);
cal.set(Calendar.DAY_OF_WEEK, Calendar.MONDAY);
System.out.println("first week Monday is "+cal.getTime());
}
}
更多内容请见原文,原文转载自:https://blog.csdn.net/qq_44639795/article/details/103123179