Click here to watch on Youtube:
https://www.youtube.com/watch?v=CZishzwC33w&list=UUhwKlOVR041tngjerWxVccw
YearDemo.java
Output
Click the below link to download the code:
https://sites.google.com/site/ramj2eev2/java_basics/YearDemo_isSupported_field.zip?attredirects=0&d=1
Github Link:
https://github.com/ramram43210/Java/tree/master/BasicJava_2018/YearDemo_isSupported_field
Bitbucket Link:
https://bitbucket.org/ramram43210/java/src/8e3f14caa10b52912934997a22df069c728f47b4/BasicJava_2018/YearDemo_isSupported_field/?at=master
See also:
All JavaEE Videos Playlist
All JavaEE Videos
All JAVA EE Links
Servlets Tutorial
All Design Patterns Links
JDBC Tutorial
Java Collection Framework Tutorial
JAVA Tutorial
Kids Tutorial
Cooking Tutorial
https://www.youtube.com/watch?v=CZishzwC33w&list=UUhwKlOVR041tngjerWxVccw
YearDemo.java
import java.time.Year;
import java.time.temporal.ChronoField;
public class YearDemo
{
public static void main(String[] args)
{
Year year = Year.of(2017);
/*
* Parameters:
*
* field - the field to check, null returns false
*
* Returns:
*
* true if the field is supported on this year, false if not
*/
boolean isYearSupported = year.isSupported(ChronoField.YEAR);
System.out.println("isYearSupported = "+isYearSupported);
boolean isMonthYearSupported = year.isSupported(ChronoField.MONTH_OF_YEAR);
System.out.println("isMonthYearSupported = "+isMonthYearSupported);
}
}
import java.time.temporal.ChronoField;
public class YearDemo
{
public static void main(String[] args)
{
Year year = Year.of(2017);
/*
* Parameters:
*
* field - the field to check, null returns false
*
* Returns:
*
* true if the field is supported on this year, false if not
*/
boolean isYearSupported = year.isSupported(ChronoField.YEAR);
System.out.println("isYearSupported = "+isYearSupported);
boolean isMonthYearSupported = year.isSupported(ChronoField.MONTH_OF_YEAR);
System.out.println("isMonthYearSupported = "+isMonthYearSupported);
}
}
Output
isYearSupported = true
isMonthYearSupported = false
isMonthYearSupported = false
Click the below link to download the code:
https://sites.google.com/site/ramj2eev2/java_basics/YearDemo_isSupported_field.zip?attredirects=0&d=1
Github Link:
https://github.com/ramram43210/Java/tree/master/BasicJava_2018/YearDemo_isSupported_field
Bitbucket Link:
https://bitbucket.org/ramram43210/java/src/8e3f14caa10b52912934997a22df069c728f47b4/BasicJava_2018/YearDemo_isSupported_field/?at=master
See also:
No comments:
Post a Comment