無為

          無為則可為,無為則至深!

            BlogJava :: 首頁 :: 聯系 :: 聚合  :: 管理
            190 Posts :: 291 Stories :: 258 Comments :: 0 Trackbacks

           import java.util.Calendar;

          import java.util.GregorianCalendar;

          public class CalTest {

          public static void main(String[] argv) {

          CalTest calTest = new CalTest();

          calTest.cal(2009, 11);

          }

          public void cal(final int year, final int month) {

          Calendar calendar = new GregorianCalendar();

          calendar.set(year, month-1, 1);

          int week = calendar.get(GregorianCalendar.DAY_OF_WEEK) - 1;

          int days = calendar.getActualMaximum(GregorianCalendar.DAY_OF_MONTH);

          System.out.println();

          System.out.println("日\t一\t二\t三\t四\t五\t六");

          for(int i = 0; i < week; i++) {

          System.out.println("\t");

          }

          for(int i = 1; i <= days; i ++) {

          System.out.print(i + "\t");

          if((week + i)%7 == 0) {

          System.out.println();

          }

          }

          }


          }


          運行效果:




          凡是有該標志的文章,都是該blog博主Caoer(草兒)原創,凡是索引、收藏
          、轉載請注明來處和原文作者。非常感謝。

          posted on 2009-11-06 20:49 草兒 閱讀(874) 評論(2)  編輯  收藏 所屬分類: JAVA WEB應用

          Feedback

          # re: Calender 2009-12-31 05:05 EllenbY22
          I guess that now men need <a href="http://www.primewritings.com">custom essay plus</a> about this good topic, because this is our business to supply you with the fantastic information connecting with <a href="http://www.primewritings.com/costs.php">costs</a>.   回復  更多評論
            

          主站蜘蛛池模板: 凤台县| 鄂伦春自治旗| 肥城市| 闻喜县| 林州市| 北宁市| 思南县| 昌都县| 湖州市| 拉萨市| 宣武区| 沙田区| 连南| 淳化县| 中西区| 仲巴县| 大方县| 大冶市| 周宁县| 武鸣县| 淳安县| 恭城| 秀山| 毕节市| 民县| 方山县| 大理市| 茌平县| 应用必备| 县级市| 双鸭山市| 贡觉县| 中超| 赣州市| 尼玛县| 武川县| 交城县| 阿拉善盟| 汝州市| 彭州市| 来凤县|