Javatpoint Logo
Javatpoint Logo

Java Calendar getWeeksInWeekYear() Method

The getWeeksInWeekYear() method of java.util.Calendar class returns the total number of weeks in a week year in the integer form.

Syntax

Parameter

No parameter is passed.

Returns

Returns the integer number of weeks in week year

Throws

UnsupportedOperationException: if any week number is not defined in the calendar.

Example 1

Test it Now

Output:

Current Time:Thu Aug 09 16:36:58 PDT 2018
Weeks in week year :52
Changed Time:Fri Jun 07 16:36:58 PDT 1996
Weeks in week year :52

Example 2

Test it Now

Output:

Week : 52
Weekayear  : 1969
Year  : 1969
Week : 52



Please Share

facebook twitter google plus pinterest