Calendar.getWeekYear() has the following syntax.
public int getWeekYear()
In the following code shows how to use Calendar.getWeekYear() method.
//from w w w.jav a2 s . c om import java.util.Calendar; public class Main { public static void main(String[] args) { Calendar now = Calendar.getInstance(); System.out.print(now.getWeekYear()); } }
The code above generates the following result.