Java Calendar.getMinimum(int field)

Syntax

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

public abstract int getMinimum(int field)

Example

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


/*  w w  w .  j ava  2s  . c o m*/

import java.util.Calendar;

public class Main {

   public static void main(String[] args) {

      Calendar cal = Calendar.getInstance();

      // print the minimum value for years
      int min=cal.getMinimum(Calendar.YEAR);
      System.out.println("Minimum Years: "+ min);
   }
}

The code above generates the following result.