Click here to watch on Youtube:
https://www.youtube.com/watch?v=sOFj1cgzNJM&list=UUhwKlOVR041tngjerWxVccw
MonthDemo.java
import java.time.Month;
public class MonthDemo
{
public static void main(String[] args)
{
Month month = Month.FEBRUARY;
System.out.println("month = " + month);
/*
* Returns:the minimum length of this month in days, from 28
* to 31
*/
System.out.println("min length = " + month.minLength());
/*
* Returns:the maximum length of this month in days, from 29
* to 31
*/
System.out.println("max length = " + month.maxLength());
}
}
public class MonthDemo
{
public static void main(String[] args)
{
Month month = Month.FEBRUARY;
System.out.println("month = " + month);
/*
* Returns:the minimum length of this month in days, from 28
* to 31
*/
System.out.println("min length = " + month.minLength());
/*
* Returns:the maximum length of this month in days, from 29
* to 31
*/
System.out.println("max length = " + month.maxLength());
}
}
Output
month = FEBRUARY
min length = 28
max length = 29
min length = 28
max length = 29
Click the below link to download the code:
https://sites.google.com/site/ramj2eev2/java_basics/MonthDemo_min_max.zip?attredirects=0&d=1
Github Link:
https://github.com/ramram43210/Java/tree/master/BasicJava_2018/MonthDemo_min_max
Bitbucket Link:
https://bitbucket.org/ramram43210/java/src/21e60817517fc375c595b23163eb96a6fc305b37/BasicJava_2018/MonthDemo_min_max/?at=master
See also:
No comments:
Post a Comment