How Calendar works

If you're like me though, you'd like to know a little bit about how this Calendar object is really operating. Is it storing the month, day, and seconds of time in separate fields, or is there one big number that contains all of this information?

If we spend some time and take a look at the methods available to us in the Calendar class implementation, we'll find these two methods: setTimeInMillis() and its sister method getTimeInMillis() as shown in the following screenshot:

The fact that these methods are specially set aside is a really great window of opportunity for us to see how the Calendar class really thinks.

Let's ...

Get Java Programming for Beginners now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.