無為

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

            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 草兒 閱讀(862) 評論(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>.   回復  更多評論
            

          主站蜘蛛池模板: 南康市| 朝阳区| 灌阳县| 萍乡市| 北流市| 麻城市| 大埔县| 新郑市| 乌鲁木齐市| 邹城市| 耿马| 岑溪市| 德格县| 成安县| 慈溪市| 鄢陵县| 广昌县| 广安市| 崇明县| 蓝田县| 游戏| 河东区| 阿荣旗| 略阳县| 营口市| 大化| 临颍县| 宜兰县| 色达县| 集安市| 富民县| 汝城县| 玛纳斯县| 盘锦市| 巴塘县| 二连浩特市| 巴林右旗| 龙川县| 南涧| 祁阳县| 葫芦岛市|