Java Calendar getGreatestMinimum方法


Java Calendar getGreatestMinimum方法

package com.codingdict;

import java.util.*;

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

      // create a calendar    
      Calendar cal = new GregorianCalendar(2010, 9, 15);

      // print the greatest min. for year field
      int result = cal.getGreatestMinimum(Calendar.YEAR);
      System.out.println("The minimum is: " + result);
   }
}