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