Why is jums.util.Calendar not using Enums?

I sometimes get frustrated by the lack of type safety with juCalendar and wonder if there is a good reason not to use the enumerations in the calendar API that went through my head, or if the only reason is that it was probably written before the enumerations were part of the language and it was not worth breaking the old code.

The secondary question is: is it worth the time to create a more secure type wrapper around the Calendar class, or has it been done before?


Summary: It has Calendar existed since Java 1.1, when it was Enumsjust done in Java 5, JODA Time is considered the best replacement package for Calendar.

+3
source share
3 answers

Java, . - , , , , - .

+7

, ( 5).

JODA Time .

+6

The class has Calendarexisted since Java 1.1, so it does not use Enums.

I highly recommend using Joda time rather than a train wreck java.util.Calendar.

+2
source

All Articles