Wednesday 25 July 2018

How to use isLenient() and isWeekDateSupported() methods of Java.util.calendar class


Click here to watch on Youtube: 
https://www.youtube.com/watch?v=k8ftzqB5r0Q&list=UUhwKlOVR041tngjerWxVccw 

CalendarDemo.java

import java.util.Calendar;

public class CalendarDemo
{
    public static void main(String[] args)
    {
        Calendar cal = Calendar.getInstance();

        /*
         * Returns:true if the interpretation mode of this calendar is
         * lenient; false otherwise.
         */

        boolean isLenient = cal.isLenient();
        System.out.println("isLenient = " + isLenient);

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

        boolean isWeekDaySupported = cal.isWeekDateSupported();
        System.out
                .print("isWeekDaySupported = " + isWeekDaySupported);
    }
}

Output

isLenient = true
isWeekDaySupported = true

Click the below link to download the code:
https://sites.google.com/site/ramj2eev2/java_basics/CalendarDemo_isLenient_isWeekDateSupported.zip?attredirects=0&d=1

Github Link:
https://github.com/ramram43210/Java/tree/master/BasicJava_2018/CalendarDemo_isLenient_isWeekDateSupported

Bitbucket Link:
https://bitbucket.org/ramram43210/java/src/b1e669f4abac38a0eb65bfeb213dca88c58230cc/BasicJava_2018/CalendarDemo_isLenient_isWeekDateSupported/?at=master

See also:

  • All JavaEE Videos Playlist
  • All JavaEE Videos
  • All JAVA EE Links
  • Spring Tutorial
  • Servlets Tutorial
  • All Design Patterns Links
  • JDBC Tutorial
  • Java Collection Framework Tutorial
  • JAVA Tutorial
  • Kids Tutorial
  • Cooking Tutorial
  • No comments:

    Post a Comment