Click here to watch on Youtube:
https://www.youtube.com/watch?v=61ACmhN9FWQ&list=UUhwKlOVR041tngjerWxVccw
CalendarDemo.java
Output
Click the below link to download the code:
https://sites.google.com/site/ramj2eev2/java_basics/CalendarDemo_getMinimum.zip?attredirects=0&d=1
Github Link:
https://github.com/ramram43210/Java/tree/master/BasicJava_2018/CalendarDemo_getMinimum
Bitbucket Link:
https://bitbucket.org/ramram43210/java/src/fcab7bc6a80f12c850b8ccc28d71601c94666bbb/BasicJava_2018/CalendarDemo_getMinimum/?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
https://www.youtube.com/watch?v=61ACmhN9FWQ&list=UUhwKlOVR041tngjerWxVccw
CalendarDemo.java
import java.util.Calendar;
public class CalendarDemo
{
public static void main(String[] args)
{
Calendar cal = Calendar.getInstance();
/*
* Parameters:
*
* field - the calendar field.
*
* Returns:
*
* the minimum value for the given calendar field.
*/
// return the minimum value for days
int min = cal.getMinimum(Calendar.DAY_OF_WEEK);
System.out.println("Minimum days = " + min);
// return the minimum value for months
min = cal.getMinimum(Calendar.MONTH);
System.out.println("Minimum months = " + min);
}
}
public class CalendarDemo
{
public static void main(String[] args)
{
Calendar cal = Calendar.getInstance();
/*
* Parameters:
*
* field - the calendar field.
*
* Returns:
*
* the minimum value for the given calendar field.
*/
// return the minimum value for days
int min = cal.getMinimum(Calendar.DAY_OF_WEEK);
System.out.println("Minimum days = " + min);
// return the minimum value for months
min = cal.getMinimum(Calendar.MONTH);
System.out.println("Minimum months = " + min);
}
}
Output
Minimum days = 1
Minimum months = 0
Minimum months = 0
Click the below link to download the code:
https://sites.google.com/site/ramj2eev2/java_basics/CalendarDemo_getMinimum.zip?attredirects=0&d=1
Github Link:
https://github.com/ramram43210/Java/tree/master/BasicJava_2018/CalendarDemo_getMinimum
Bitbucket Link:
https://bitbucket.org/ramram43210/java/src/fcab7bc6a80f12c850b8ccc28d71601c94666bbb/BasicJava_2018/CalendarDemo_getMinimum/?at=master
See also:
No comments:
Post a Comment