Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

The reason for assigning the value of 0 to January in the Java Calendar is to maintain consistency with the indexing of arrays, where the first element is always at index 0. In the case of the Calendar class, the month values are represented as integers starting from 0 for January and going up to 11 for December, with each consecutive month incrementing the value by 1. This allows for efficient manipulation and comparison of dates within programs.