java.util.Date ClassThe java.util.Date class represents date and time in java. It provides constructors and methods to deal with date and time in java. The java.util.Date class implements Serializable, Cloneable and Comparable<Date> interface. It is inherited by java.sql.Date, java.sql.Time and java.sql.Timestamp interfaces. After Calendar class, most of the constructors and methods of java.util.Date class has been deprecated. Here, we are not giving list of any deprecated constructor and method. java.util.Date Class Constructors
java.util.Date Class Methods
java.util.Date ExampleLet's see the example to print date in Java using java.util.Date class. Example-1DateExample.java Output: Wed Mar 27 08:22:02 IST 2015 Example-2DateExample1.java Output: Wed Mar 27 08:22:02 IST 2015 Next Topicjava.sql.Date class |