Difference between Date class in Package java.util & Package java.sql

后端 未结 5 1057
太阳男子
太阳男子 2020-12-16 04:30

In java, both the java.util and the java.sql package contain a Date class, So what is the difference between them?

If one

5条回答
  •  囚心锁ツ
    2020-12-16 05:02

    Java.util.Date is the generic all-purpose Date object. It stores a Date (as a long) and allows you to display it.

    java.sql.Date extends java.util.Date. Main difference to note is that java.sql.Date does not have a time component.

提交回复
热议问题