Java GregorianCalendar .getMinimum (int field)

Syntax

GregorianCalendar.getMinimum(int field) has the following syntax.

public int getMinimum(int field)

Example

In the following code shows how to use GregorianCalendar.getMinimum(int field) method.


/*  ww  w.ja va 2 s . c  o  m*/

import java.util.*;

public class Main {

   public static void main(String[] args) {


      GregorianCalendar cal =
              (GregorianCalendar) GregorianCalendar.getInstance();

      // get minimum for day_of_month
      int min = cal.getMinimum(GregorianCalendar.DAY_OF_MONTH);
      System.out.println("Minimum:" + min);

      // get minimum for YEAR
      min = cal.getMinimum(GregorianCalendar.YEAR);
      System.out.println("Minimum:" + min);

   }
}

The code above generates the following result.