Click here to watch on Youtube:
https://www.youtube.com/watch?v=bgHK9-42WKw&list=UUhwKlOVR041tngjerWxVccw
CalendarDemo.java
Output
Click the below link to download the code:
https://sites.google.com/site/ramj2eev2/java_basics/CalendarDemo_clear.zip?attredirects=0&d=1
Github Link:
https://github.com/ramram43210/Java/tree/master/BasicJava_2018/CalendarDemo_clear
Bitbucket Link:
https://bitbucket.org/ramram43210/java/src/b1e669f4abac38a0eb65bfeb213dca88c58230cc/BasicJava_2018/CalendarDemo_clear/?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=bgHK9-42WKw&list=UUhwKlOVR041tngjerWxVccw
CalendarDemo.java
import java.util.Calendar;
public class CalendarDemo
{
public static void main(String[] args)
{
Calendar cal = Calendar.getInstance();
System.out.println("Before clear = " + cal.getTime());
/*
* use clear method to set all field values and time value as
* undefined.
*/
cal.clear();
System.out.println("After clear = " + cal.getTime());
}
}
public class CalendarDemo
{
public static void main(String[] args)
{
Calendar cal = Calendar.getInstance();
System.out.println("Before clear = " + cal.getTime());
/*
* use clear method to set all field values and time value as
* undefined.
*/
cal.clear();
System.out.println("After clear = " + cal.getTime());
}
}
Output
Before clear = Sun Jul 01 10:42:33 IST 2018
After clear = Thu Jan 01 00:00:00 IST 1970
After clear = Thu Jan 01 00:00:00 IST 1970
Click the below link to download the code:
https://sites.google.com/site/ramj2eev2/java_basics/CalendarDemo_clear.zip?attredirects=0&d=1
Github Link:
https://github.com/ramram43210/Java/tree/master/BasicJava_2018/CalendarDemo_clear
Bitbucket Link:
https://bitbucket.org/ramram43210/java/src/b1e669f4abac38a0eb65bfeb213dca88c58230cc/BasicJava_2018/CalendarDemo_clear/?at=master
See also:
No comments:
Post a Comment