- import java.text.DateFormatSymbols;
- import java.util.*;
- /**
- * @version 1.4 2007-04-07
- * @author Cay Horstmann
- */
- public class CalendarTest
- {
- public static void main(String[] args)
- {
- // construct d as current date
- // Locale.setDefault(Locale.ITALY);
- GregorianCalendar d = new GregorianCalendar();
- int today = d.get(Calendar.DAY_OF_MONTH);
- int month = d.get(Calendar.MONTH);
- // set d to start date of the month
- d.set(Calendar.DAY_OF_MONTH, 1);
- int weekday = d.get(Calendar.DAY_OF_WEEK);
- // get first day of week (Sunday in the U.S.)
复制代码 最后的结果为什么是下面这个样子?
求哪位大神指教???
|
|