How to get the Current Week using the Calendar class

This example shows how to get the current week, both current week of the month and current week of the year.
It is done by calling the get() method of the Calendar class passing an integer value as parameter.
This integer value can be found as static variables of the Calendar class, WEEK_OF_MONTH and WEEK_OF_YEAR.

The output from this would be this if the date is November 27:

Search for more Java info on this site here:
Custom Search

Please type any questions here.