Java Date Time - 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.

//www.  j a v a2 s  . co  m

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.