java.util.DateThe 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 Constructors
java.util.Date Methods
java.util.Date ExampleLet's see the example to print date in java using java.util.Date class. 1st way: Test it NowOutput: Wed Mar 27 08:22:02 IST 2015 2nd way: Test it NowOutput: Wed Mar 27 08:22:02 IST 2015
Next Topicjava.sql.Date class
|