Java Calendar.isLenient()

Syntax

Calendar.isLenient() has the following syntax.

public boolean isLenient()

Example

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


/*from ww w .  j  av  a  2 s  .  c  o m*/

import java.util.Calendar;

public class Main {

   public static void main(String[] args) {

      Calendar cal = Calendar.getInstance();

      // tells whether date/time interpretation is lenient.
      boolean b = cal.isLenient();
      System.out.println(b);
   }
}

The code above generates the following result.