Why were most java.util.Date methods deprecated?

后端 未结 5 985
野趣味
野趣味 2020-11-27 18:36

When you look at the javadoc of the java.util.Date class, most of the methods are deprecated. Why was this done?

5条回答
  •  眼角桃花
    2020-11-27 19:17

    • Date is mutable
    • Date doesn't have support for time zones

    The latter led to it being replaced by Calendar. And the former, combined with the ease-of-use, lead to both being replaced by Joda-Time / JSR-310 (java.time.* package)

提交回复
热议问题