3 ms·
Please avoid hurting Javas reputation by using outdated code. 1. Since Java 8 there are LocalDateTime/ZonedDateTime/etc. classes. They are immutable. LocalDate
by Traubenfuchs 10y ago
Please avoid hurting Javas reputation by using outdated code.
1. Since Java 8 there are LocalDateTime/ZonedDateTime/etc. classes. They are immutable. LocalDateTime even works with Hibernate.
2. date.setDate(int date) is deprecated for nearly 20 years. The methods Javadoc clearly states that you are changing the object. The method even returns void. Don't use it. Why are you still using it?
3. If you still want to use the less comfortable Date and Calendar, they work fine if you use them as you are supposed to.
- talideon 10y agoHe does actually refer to this, but he could be more explicit on point (2) rather than referring to it obliquely.