Java Calendar internalGet方法


Java Calendar internalGet方法

package com.codingdict;

import java.util.*;

public class CalendarDemo extends GregorianCalendar {
   public static void main(String[] args) {

      // create a new calendar
      CalendarDemo cal = new CalendarDemo();

      // print the current date
      System.out.println("The current date is : " + cal.getTime());

      // use internal get to get the year
      System.out.println("Year is : " + cal.internalGet(YEAR));

      // use internal get to get the month
      System.out.println("Month is : " + cal.internalGet(MONTH));
   }
}