Javatpoint Logo
Javatpoint Logo

Java Calendar getWeekYear() Method

The getWeekYear() method of java.util.Calendar class is a public method. This method gets the week year of calendar object and returns in integer the week year of calendar.

Syntax

Parameter

No parameter is passed.

Returns

Returns in integer week year of current calendar object .

Throws

UnsupportedOperationException

Example 1

Test it Now

Output:

Current Time:Fri Aug 10 10:52:54 PDT 2018
 week year :2018
Changed Time:Fri Jun 07 10:52:54 PDT 1996
Weeks in week year :1996

Example 2

Test it Now

Output:

Week : 52
Weekayear  : 1969
Year  : 1969



Please Share

facebook twitter google plus pinterest