無為

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

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

          主站蜘蛛池模板: 临海市| 浏阳市| 开阳县| 炎陵县| 南华县| 托克托县| 新乡市| 民和| 望江县| 沙田区| 鄂温| 遂昌县| 沭阳县| 岳阳县| 泾阳县| 贵阳市| 万山特区| 疏附县| 房山区| 固阳县| 青河县| 汉寿县| 庆元县| 格尔木市| 北辰区| 施秉县| 靖江市| 太保市| 洛阳市| 大连市| 丹寨县| 抚宁县| 治县。| 白河县| 寻乌县| 蓝山县| 勐海县| 白银市| 沛县| 铁岭县| 长垣县|