Although I don’t know, it’s quite interesting. The current usage of the Date class is generally to treat the date as a whole to perform some operations, such as Format, and Calendar seems to be specially designed to subdivide Date. Date's getXXX is now Deprecated, and the doc clearly states that You use the method corresponding to Calendar, and it feels like Calendar is designed to make up for Date design flaws or something.
The simple difference is
java.util.Date
is a date datajava.util.Calendar
Used for date related calculationsIn addition, if you can’t find the function you need in Date, go to Calendar and find it. You will know which one can do what.
Although I don’t know, it’s quite interesting. The current usage of the Date class is generally to treat the date as a whole to perform some operations, such as Format, and Calendar seems to be specially designed to subdivide Date. Date's getXXX is now Deprecated, and the doc clearly states that You use the method corresponding to Calendar, and it feels like Calendar is designed to make up for Date design flaws or something.