A股上市公司传智教育(股票代码 003032)旗下技术交流社区北京昌平校区

 找回密码
 加入黑马

QQ登录

只需一步,快速开始

© qiubaoyang 中级黑马   /  2014-6-16 12:32  /  637 人查看  /  0 人回复  /   0 人收藏 转载请遵从CC协议 禁止商业使用本文

  1. import java.text.DateFormatSymbols;
  2. import java.util.*;

  3. /**
  4. * @version 1.4 2007-04-07
  5. * @author Cay Horstmann
  6. */

  7. public class CalendarTest
  8. {
  9.    public static void main(String[] args)
  10.    {
  11.       // construct d as current date
  12. //          Locale.setDefault(Locale.ITALY);
  13.       GregorianCalendar d = new GregorianCalendar();

  14.       int today = d.get(Calendar.DAY_OF_MONTH);

  15.           int month = d.get(Calendar.MONTH);

  16.       // set d to start date of the month
  17.       d.set(Calendar.DAY_OF_MONTH, 1);

  18.       int weekday = d.get(Calendar.DAY_OF_WEEK);

  19.       // get first day of week (Sunday in the U.S.)
复制代码
最后的结果为什么是下面这个样子?


求哪位大神指教???

0 个回复

您需要登录后才可以回帖 登录 | 加入黑马