Java Utility Library

Java Calendar - isWeekDateSupported() Method



The java.util.Calendar.isWeekDateSupported() method is used to check whether this Calendar supports week dates. The default implementation of this method returns false.

Syntax

public boolean isWeekDateSupported()

Parameters

No parameter is required.

Return Value

Returns true if this Calendar supports week dates; false otherwise.

Exception

NA

Example:

In the example below, the java.util.Calendar.isWeekDateSupported() method is used to test whether the given Calendar supports week dates or not.

import java.util.*;

public class MyClass {
  public static void main(String[] args) {
    //creating a Calendar object with specified date
    Calendar Cal = new GregorianCalendar(2015, 10, 25);

    //printing the Calendar
    System.out.println("The Calendar is: " + Cal.getTime());

    //Printing whether the Calendar supports week dates
    System.out.println("Is Week Date Supported?: " + Cal.isWeekDateSupported());
  }
}

The output of the above code will be:

The Calendar is: Wed Nov 25 00:00:00 UTC 2015
Is Week Date Supported?: true

❮ Java.util - Calendar