Java Calendar.getWeekYear()

Syntax

Calendar.getWeekYear() has the following syntax.

public int getWeekYear()

Example

In the following code shows how to use Calendar.getWeekYear() method.


/*from www . ja va2  s  . c o m*/
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.