Java Calendar .getMinimalDaysInFirstWeek ()

Syntax

Calendar.getMinimalDaysInFirstWeek() has the following syntax.

public int getMinimalDaysInFirstWeek()

Example

In the following code shows how to use Calendar.getMinimalDaysInFirstWeek() method.


/*  w  ww.  j av  a2  s  .  c  om*/

import java.util.Calendar;

public class Main {

   public static void main(String[] args) {

      Calendar cal = Calendar.getInstance();

      // get what the minimal days required in the first week of the year 
      int i = cal.getMinimalDaysInFirstWeek();

      // print the result
      System.out.println("Minimal days required :" + i);
   }
}

The code above generates the following result.