Are java.util.Date and java.util.Calendar deprecated?
问题 It seems that the new java.time API offers everything from java.util.Date and much more. Is there any reason to use java.util.Date when the newer java.time API is there since Java 8? Should java.util.Date and java.util.Calendar be avoided completely? 回答1: Short answer: The new API java.time is way better than the old world with java.util.Date and java.util.Calendar . So yes, the new API should be preferred in new code. For a quick overview: Once I had written a comparison of features in table