An example application using a method of the Date class:
-
import java.util.Date;
-
class DateApplication
-
{ public static void main ()
-
{ Date today = new Date();
-
Date medieval = new Date(1400, 12, 25);
-
if (today.after (medieval))
-
System.out.println( "Today is not medieval!");
-
}}
|