無為

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

            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>.   回復  更多評論
            

          主站蜘蛛池模板: 武清区| 湘阴县| 永福县| 平谷区| 和田县| 荥经县| 钟祥市| 吴川市| 秦安县| 沙田区| 托克逊县| 漳平市| 霍邱县| 金湖县| 乌审旗| 灌南县| 灌云县| 苍南县| 历史| 沾益县| 汨罗市| 乌拉特后旗| 靖宇县| 栾城县| 光山县| 海门市| 城市| 江安县| 滦南县| 宿松县| 邛崃市| 涞水县| 临朐县| 大邑县| 竹北市| 兴和县| 萝北县| 安义县| 南京市| 明水县| 泰宁县|